Re: failed to execute the psql case statement which has the function call.

Поиск
Список
Период
Сортировка
От sagar jadhav
Тема Re: failed to execute the psql case statement which has the function call.
Дата
Msg-id CACPo9Dp=aq9cgn2ssyC6YFHsJ5Wbq1ZbRYNDJWeujerQa3TLVA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: failed to execute the psql case statement which has the function call.  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: failed to execute the psql case statement which has the function call.  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-admin
Use single quotes ('attribute') for variable in function.



On Tue, Apr 5, 2022 at 7:04 PM David G. Johnston <david.g.johnston@gmail.com> wrote:


On Tuesday, April 5, 2022, Nikhil Ingale <niks.bgm@gmail.com> wrote:
Hi All,

I've a case statement where I'm calling the user defined postgres function and failed to execute the same. Because it's assuming the variable passed inside the function as a column for the table.

You cannot use variables for identifiers in raw sql.  If you need to do that you must use dynamic sql - build a string using format and execute it.

David J.
 

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: failed to execute the psql case statement which has the function call.
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: failed to execute the psql case statement which has the function call.