← Back to team overview

dhis2-devs team mailing list archive

Re: help with the query

 

On Tue, Sep 29, 2009 at 8:53 AM, Yusuph Kassim <yusuphk@xxxxxxxxx> wrote:
> this is the query that doesnt work
> SELECT pivotsource_indicator_ou4.indicator,
> pivotsource_indicator_ou4.orgunit1, pivotsource_indicator_ou4.ou1,
> pivotsource_indicator_ou4.orgunit2, pivotsource_indicator_ou4.ou2,
> pivotsource_indicator_ou4.orgunit3, pivotsource_indicator_ou4.ou3,
> pivotsource_indicator_ou4.orgunit4, pivotsource_indicator_ou4.ou4,
> pivotsource_indicator_ou4.periodid, pivotsource_indicator_ou4.periodtype,
> pivotsource_indicator_ou4.year, pivotsource_indicator_ou4.month,
> pivotsource_indicator_ou4.period, pivotsource_indicator_ou4.numxfactor,
> pivotsource_indicator_ou4.factor, pivotsource_indicator_ou4.numeratorvalue,
> pivotsource_indicator_ou4.denominatorvalue,
> pivotsource_indicator_ou4.annualized, pivotsource_indicator_ou4.level
> FROM dhis2_znzmay.public.pivotsource_indicator_ou4 pivotsource_indicator_ou4



And you are executing this query from which database? dhis2 or
dhis2_znmay? If you are executing it from dhis2 this query will not
work.

Postgresql does not allow cross-databaes queries by default (unlike
MS-SQL), thus the error message. You will need to either 1) create a
separate ODBC connection to the dhis2_znmay data base, remove the
database reference and link the query through that second ODBC
connection or 2) implement cross-database query support
http://www.postgresql.org/docs/8.3/static/dblink.html

Regards,
Jason



Follow ups

References