Thread: Triggers

Triggers

From
Jamie Deppeler
Date:
Hi,

Just doing some testing at the moment and trying to make a trigger that
consists of a insert statement which as a result of an sql querty!

Is this possible? if so could someone give me some pointers as i am
having no luck trying to get this to work, have even tried this but
still doesnt work.

begin
   begin
   INSERT INTO wip.resourceplan
  (
     "name",
     "notes",
     "hrs",
     "glcode1",
     "glcode2",
     "chargeratename",
     "chargeratevalue",
     "servicefeename",
     "servicefeevalue")

('1','2','3','4','5','6','7','8','9')
   return null;
end;



Re: Triggers

From
Richard Huxton
Date:
Jamie Deppeler wrote:
> Hi,
>
> Just doing some testing at the moment and trying to make a trigger that
> consists of a insert statement which as a result of an sql querty!

Look into using EXECUTE - it accepts a string expression and executes
it. Don't forget to use the quote_xxx() functions to quote identifiers etc.

--
   Richard Huxton
   Archonet Ltd