Subject Re: [Firebird-general] possible to CREATE a TRIGGER from a INSIDE?
Author Dennis Mulder
@skander_sp
Next time post technical issues in the Firebird-support group, where
more people are lurking to tackle our problems.
Besides, we don't want to make Ann angry ;)
This group is only for general Firebird related issues.

Dennis

skander_sp wrote:

>I'm trying to create a new trigger from INSIDE the database, trhough a
>procedure using the EXECUTE STATEMENT
>
>I create a string with all the syntax (really only a command)
>
>trg=
> 'SET TERM ^ ; '||
> 'CREATE TRIGGER '||new.table||' for '||NEW.table||' '||
> 'AFTER '||CASE new.accion when 'A' then 'INSERT'
> when 'M' then 'UPDATE'
> when 'B' then 'DELETE' end||' '||
> 'POSITION 100 '||
> 'AS BEGIN '||
> 'EXECUTE PROCEDURE MY_PROCEDURE; '
> 'END ^ '||
> 'SET TERM ; ^ '
>
>but when I try
>
>EXECUTE STATEMENT trg
>
>i got some kind of error
>
>I try whithout "set term" comamnd but same result...
>
>anyone know the way to DO it?
>
>
>
>
>
>
>Community email addresses:
> Post message: Firebird-general@yahoogroups.com
> Subscribe: Firebird-general-subscribe@yahoogroups.com
> Unsubscribe: Firebird-general-unsubscribe@yahoogroups.com
> List owner: Firebird-general-owner@yahoogroups.com
>
>Shortcut URL to this page:
> http://www.yahoogroups.com/community/Firebird-general
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>