Search Postgresql Archives

Using Variables in dblink_build_sql_insert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux