Re: PG and dynamic statements in stored procedures/triggers?

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Durumdara <durumdara(at)gmail(dot)com>
Subject: Re: PG and dynamic statements in stored procedures/triggers?
Date: 2011-03-07 14:39:45
Message-ID: 201103070639.46327.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)klaver(at)gmail(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vibhor Kumar 2011-03-07 14:40:01 Re: PG and dynamic statements in stored procedures/triggers?
Previous Message Durumdara 2011-03-07 14:32:44 PG and dynamic statements in stored procedures/triggers?