Search Postgresql Archives

Re: need help with plpgsql execute insert

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

 



developer@xxxxxxxxxxxx wrote:
I believe you are wrong.  the EXECUTE is being given 11 columns, it
expects 1.  I think you need to form your execute query like;

EXECUTE 'INSERT INTO payment (
id,amount,accepted_date,  company_id ,  date ,
patient_responsible_party_id   patient_contact_responsible_party_id ,
insurer_network_responsible_party_id,  type,   status)
values (' || quote_ident(paymentId) || ',' || ...

Something of that fashion.

Thanks for replying.  So the '%' symbol can not be used with an EXECUTE
'INSERT statement.  I thought this was exactly what it was for?

No - the RAISE statement takes that format, nothing else.

However, you only need the EXECUTE for statements that you need planned every time they are called, e.g. can have their table-name changed. You should just be able to write:
  INSERT INTO ... VALUES (paymentId, 0.0, data.create_date ...)

P.S. - you can remove much of a message when you reply, that way people can quickly follow the new parts of a message-thread.

--
  Richard Huxton
  Archonet Ltd


[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