durumdara wrote:
Quote:
I want to ask that is pg supports dynamic usage of SQL, or variable as
SQL (or part of SQL) statement?
:tablename = call CreateTempTable;
insert into :tablename ....
drop table :tablename
or (FireBird like cursor handling):
sql = "select * from " || :tablename || " where..."
for select :sql ....
... |
SQL itself does not support that, but there are things like that
in psql:
\set varname value
CREATE TABLE :varname (id integer);
INSERT INTO :varname VALUES (1);
Does that help?
Yours,
Laurenz Albe