Re: returning values to variables from dynamic SQL
От | David Johnston |
---|---|
Тема | Re: returning values to variables from dynamic SQL |
Дата | |
Msg-id | 00ea01cd8e1b$a4435630$ecca0290$@yahoo.com обсуждение исходный текст |
Ответ на | returning values to variables from dynamic SQL (James Sharrett <jsharrett@tidemark.net>) |
Список | pgsql-sql |
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of James Sharrett Sent: Saturday, September 08, 2012 6:24 PM To: pgsql-sql@postgresql.org Subject: [SQL] returning values to variables from dynamic SQL I have a PG function ( using plpgsql) that calls a number of sub functions also in plpgsql. I have two main problems that seem to be variations on the same theme of running dynamic SQL from a variable with the EXECUTE statement and returning the results back to a variable defined in the calling function. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Please read: http://www.postgresql.org/docs/9.0/interactive/plpgsql-statements.html#PLPGS QL-STATEMENTS-EXECUTING-DYN Basically when you use "EXECUTE" you do not embed the "INTO" as part of the SQL query but rather INTO becomes a modifier of the EXECUTE itself: EXECUTE 'some query' INTO {variables} David J.
В списке pgsql-sql по дате отправления: