Re: Anything akin to an Evaluate Statement in Postgresql?

Поиск
Список
Период
Сортировка
От A E
Тема Re: Anything akin to an Evaluate Statement in Postgresql?
Дата
Msg-id 20040106162424.9900.qmail@web12102.mail.yahoo.com
обсуждение исходный текст
Ответ на Re: Anything akin to an Evaluate Statement in Postgresql?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
objectdefinition is defined as a record variable. It works fine when I remove the statement trying to get the dynamically concocted string executed and the results placed into the aliasvalue variable which is varchar. 
 
My first question is, Can you perform a select on a variable? Such as in the case of executing the dynamic string of objectdefinition.[Whatever Value]
 
My next question is do you have declare the variable being used in a for in execute as a record variable? If so is this by design or limitation?
 
My last question is has anyone else run into this before? Where the name of the column was unknown, and it was dynamically generated and needed to be turned into a reference instead of a string?
 
TIA
 
Alex 

Tom Lane <tgl@sss.pgh.pa.us> wrote:
A E writes:
> I tried to use a for in loop to execute the statement to try to get some dynamic functionality but I get "ERROR: missing ".." at end of SQL expression" what am I doing wrong?

Did you declare the loop variable (here, "objectdefinition") as a
record or rowtype variable? If the loop variable is not known,
plpgsql assumes this is a locally-declared-integer kind of FOR loop,
which leads it to expect the lowbound .. highbound kind of syntax,
which leads to the above error message.

regards, tom lane

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Anything akin to an Evaluate Statement in Postgresql?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: TODO list