Using Variables in dblink_build_sql_insert - Mailing list pgsql-general

From ldrlj1
Subject Using Variables in dblink_build_sql_insert
Date
Msg-id 1364836739700-5750332.post@n5.nabble.com
Whole thread Raw
List 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 by date:

Previous
From: ldrlj1
Date:
Subject: Re: Using Variables in dblink_build_sql_insert
Next
From: tushar ahuja
Date:
Subject: Is 'Peer authentication' supported on HPUX ?