Using Variables in dblink_build_sql_insert

Поиск
Список
Период
Сортировка
От ldrlj1
Тема Using Variables in dblink_build_sql_insert
Дата
Msg-id 1364836739700-5750332.post@n5.nabble.com
обсуждение исходный текст
Список pgsql-general
Here is what I get from the documentation:

The last two arguments are:
text[] src_pk_att_vals_array,
text[] tgt_pk_att_vals_array
SELECT dblink_build_sql_insert('foo', '1 2', 2, '{"1", "a"}', '{"1",
"b''a"}');

How do I replace the src and tgt with variables from within my function? I
can easily create the insert statement with a true value, but if I loop over
a record and try to dynamically set the src and tgt I get errors.

declare

  bob_record record;
  frank character varying[];

for bob_record in select bob from table;
  loop
    frank = bob_record.bob;
    SELECT dblink_build_sql_insert('foo', '1',1, '{"frank"}', '{frank"}');
  end loop;



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Using-Variables-in-dblink-build-sql-insert-tp5750332.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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

Предыдущее
От: ldrlj1
Дата:
Сообщение: Re: Using Variables in dblink_build_sql_insert
Следующее
От: tushar ahuja
Дата:
Сообщение: Is 'Peer authentication' supported on HPUX ?