Re: Command to execute SQL string

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: Command to execute SQL string
Дата
Msg-id CA+bJJbzhp01YDyx-MjECMPxB2jKLDFkZXh2GCZMwv1DSTBWM0w@mail.gmail.com
обсуждение исходный текст
Ответ на Command to execute SQL string  (Łukasz Jarych <jaryszek@gmail.com>)
Ответы Re: Command to execute SQL string
Re: Command to execute SQL string
Список pgsql-general
Hello:



On Thu, Mar 8, 2018 at 1:26 PM, Łukasz Jarych <jaryszek@gmail.com> wrote:
> i have a table when i have string in each row,
> for example "DELETE FROM t_test WHERE ID = 3".
>
> I want to execute for each row this command.
> It is possible?

I supose you mean execute the command contained in each row. Anyway,
it is easy with a procedure, look for example at

https://www.postgresql.org/docs/10/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN

just do a loop on your command table, follow the examples and you
should be done.

Francisco Olarte.

PS:
> Jacek
Is this the same as Łukasz or Jarych ?

F.O.


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

Предыдущее
От: Łukasz Jarych
Дата:
Сообщение: Trigger to create string to inverse SQL statement
Следующее
От: Francisco Olarte
Дата:
Сообщение: Re: Trigger to create string to inverse SQL statement