Re: How to assign variable in array value inside function proc.

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: How to assign variable in array value inside function proc.
Дата
Msg-id CAKFQuwaGft2SF0tcYA1NhvwiQ5Yby6-m13MzyJ9QB7TdX8KE+w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to assign variable in array value inside function proc.  (aditya desai <admad123@gmail.com>)
Список pgsql-sql
On Mon, Nov 1, 2021 at 9:20 AM aditya desai <admad123@gmail.com> wrote:
Hi ,here is another issue now. If you see the last value in the source table it considers commas as separate columns and gives errors. Can you please help?

v_message:=   array(select '(' || columname || ',' || oldvalue::text || ',' || newvalue::text ||')' from testaditya2);


Please don't top-post.  Also, take the time to remove anything not necessary to provide useful context.

The only help I can give is to reiterate that trying to do string concatenation and writing out text literals for arrays and composites is something that should just be avoided.  If you cannot, learn the quoting and escaping rules for the thing you are trying to build and obey them.

David J.

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

Предыдущее
От: aditya desai
Дата:
Сообщение: Re: How to assign variable in array value inside function proc.
Следующее
От: aditya desai
Дата:
Сообщение: Constructing colum name as alias