Re: Executing SQL commands via triggers without the use of procedures
От | Jeff Eckermann |
---|---|
Тема | Re: Executing SQL commands via triggers without the use of procedures |
Дата | |
Msg-id | 20030301163551.66721.qmail@web20809.mail.yahoo.com обсуждение исходный текст |
Ответ на | Executing SQL commands via triggers without the use of procedures ("Susan Hoddinott" <susan@perth.dialix.com.au>) |
Список | pgsql-sql |
--- Susan Hoddinott <susan@perth.dialix.com.au> wrote: > Hello, > > Having scoured the relevant documentation I cannot > find anything which indicates how I simply create a > database trigger to insert into a second table after > insert on a first table, without the use of a > procedure. As I do not want return values etc. this > seems like overkill. Is it possible to create a > trigger which executes SQL directly without the need > to create a procedure? If so, what is the syntax? > You don't need to worry about those return values; nothing will be returned to your application from a trigger function. AFAICT the only difference between PostgreSQL and other DBMSs is that (at least some) others put the procedural logic inside the "create trigger" statement, whereas PostgreSQL puts it in a separate function. You need to think about this only at statement creation time; otherwise everything works just the same. One tip: always use the "create or replace function" syntax, to avoid having your trigger become confused if you change your function definition. __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/
В списке pgsql-sql по дате отправления: