← Back to team overview

dhis2-devs team mailing list archive

Sql view does not excute my SQL

 

I have this simply query:
-- 
select * from v_omissos
--

The v_omissos is a view for:
CREATE OR REPLACE VIEW v_omissos AS
select '999' AS `OLDMISSCODE`, count(0) AS `contagem` from `datavalue` where
(`datavalue`.`value` = '999')
union all
select '9999' AS `OLDMISSCODE`,count(0) AS `count(*)` from `datavalue` where
(`datavalue`.`value` = '9999')
union all select 'empty' AS `OLDMISSCODE`,count(0) AS `count(*)` from
`datavalue` where (trim(`datavalue`.`value`) = '')
union all select 'NULL' AS `OLDMISSCODE`,count(0) AS `count(*)` from
`datavalue` where isnull(`datavalue`.`value`) union all
select 'NA from R conversion' AS `OLDMISSCODE`,count(0) AS `count(*)` from
`datavalue` where (`datavalue`.`value` = 'NA')

That query has results directly on mysql but DHIS 2 claims
"Please execute query to create View table before viewing". Actually I have
executed it.

Nothing apears on the logs.

Caveman

Follow ups