Re: FW: pgscript & select

From: Jure Kobal <j(dot)kobal(at)gmx(dot)com>
To: pgadmin-support(at)postgresql(dot)org
Cc: "Little, Douglas" <DOUGLAS(dot)LITTLE(at)orbitz(dot)com>
Subject: Re: FW: pgscript & select
Date: 2010-01-23 17:52:35
Message-ID: 201001231852.35717.j.kobal@gmx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support


On Saturday 23 January 2010 18:17:15 Little, Douglas wrote:
> It's not clear to me from the doc that pgscript doesn't work with select
> statements. I'm trying to run
>
>
> set @databasename='orbitz_hist_schema_hods' ;
>
> select *
> from pg_catalog.pg_namespace n1
> where n1.nspname = '@databasename'
> ;
>
> And when executed, I get no results in the data output tab.
> Is this supposed to work?
>

You should inser the data from the SELECT into a variable and then print it.

Something like that should work:

SET @databasename='orbitz_hist_schema_hods' ;

SET @data = select *
from pg_catalog.pg_namespace n1
where n1.nspname = '@databasename';

PRINT @data;

This way you will get all the data returned by the SELECT statemen.
For a specific row and column you then use

PRINT @data[<row>][<column>];

Regards,
Jure

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Guillaume Lelarge 2010-01-23 18:03:40 Re: enhancement request. please enable object details copy
Previous Message Little, Douglas 2010-01-23 17:17:15 FW: pgscript & select