dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #02360
Re: help with the query
I am having each database with its own connection. I actually tried to
create direct from the ODBC connection and also tried to create the
connection as I was creating the query, but both ways gives me the same
error.
On Tue, Sep 29, 2009 at 10:00 AM, Jason Pickering <
jason.p.pickering@xxxxxxxxx> wrote:
> 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
>
--
Yusuph Kassim Kulindwa,
University of Dar Es Salaam,
Department of Computer Science,
System Developer/ Research Assistant.
Cell: +255 713 535648
Follow ups
References