Search Postgresql Archives

Re: Dynamic DDL

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

 



"Ketema" <ketema@xxxxxxxxx> writes:
> I have an example were I have to build a string in the below manner:

> values (' || new.tpv_success_id || ',''' || new.order_date || ''',' ||
> new.tpv_id || ',' || new.ver_code || ',''' || new.agent_name || ''','
> || new.agent_id || ','
> 		|| new.acct_id || ',''' || new.first_name || ''',''' ||
> new.last_name || ''',''' || new.ssn || ''',''' ||
> coalesce(new.dl_number,'') || ''',''' || coalesce(new.spouse_name, '')
> || ''',''' || coalesce(new.spouse_ssn,'') || ''',''' etc...

This looks to me like you're simply willfully ignoring the easy path.
There's nothing there that wouldn't work just as well without EXECUTE,
viz

values (new.tpv_success_id, new.order_date, new.tpv_id, new.ver_code,
new.agent_name, new.agent_id, new.acct_id, new.first_name,
new.last_name, new.ssn, new.dl_number, new.spouse_name, new.spouse_ssn,
etc...

			regards, tom lane


[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