Re: PG and dynamic statements in stored procedures/triggers? - Mailing list pgsql-general

From Adrian Klaver
Subject Re: PG and dynamic statements in stored procedures/triggers?
Date
Msg-id 201103070639.46327.adrian.klaver@gmail.com
Whole thread Raw
In response to PG and dynamic statements in stored procedures/triggers?  (Durumdara <durumdara@gmail.com>)
Responses Re: PG and dynamic statements in stored procedures/triggers?  (Durumdara <durumdara@gmail.com>)
List pgsql-general
On Monday, March 07, 2011 6:32:44 am Durumdara wrote:
> Hi!
>
> In other RDBMS I found a way to make dynamic statements.
> I can use variables, or concat the SQL segments, and execute it all.
>
> :tablename = call CreateTempTable;
>
> insert into :tablename ....
> drop table :tablename
>
> or (FireBird like cursor handling):
>
> sql = "select * from " || :tablename || " where..."
> for select :sql ....
> ...
>
> Can I do same thing in PGSQL too?
>
> Thanks:
>    dd

http://www.postgresql.org/docs/9.0/interactive/plpgsql-statements.html#PLPGSQL-
STATEMENTS-EXECUTING-DYN
--
Adrian Klaver
adrian.klaver@gmail.com

pgsql-general by date:

Previous
From: Vibhor Kumar
Date:
Subject: Re: PG and dynamic statements in stored procedures/triggers?
Next
From: Durumdara
Date:
Subject: Re: PG and dynamic statements in stored procedures/triggers?