Re: Dynamic DDL
| От | Tom Lane |
|---|---|
| Тема | Re: Dynamic DDL |
| Дата | |
| Msg-id | 11421.1176762265@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Dynamic DDL ("Ketema" <ketema@gmail.com>) |
| Ответы |
Re: Dynamic DDL
|
| Список | pgsql-general |
"Ketema" <ketema@gmail.com> 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
В списке pgsql-general по дате отправления: