PG and dynamic statements in stored procedures/triggers?

From: Durumdara <durumdara(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: PG and dynamic statements in stored procedures/triggers?
Date: 2011-03-07 14:32:44
Message-ID: AANLkTimNsaGkyd6YEJNWwZEXa2M_Jng37hqoc7Q+4hKA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2011-03-07 14:39:45 Re: PG and dynamic statements in stored procedures/triggers?
Previous Message yagru_alvarez 2011-03-07 14:25:37 Logic AND between some strings