Subject Re: possible to CREATE a TRIGGER from a INSIDE?
Author Adam
--- In firebird-support@yahoogroups.com, "skander_sp"
<skander_sp@y...> wrote:
>
> I'm trying to create a new trigger from INSIDE the database, into a
> procedure using the EXECUTE STATEMENT
>
> I create a string with all the syntax (really only a command)
>
> EXECUTE STATEMENT
> 'CREATE TRIGGER TRIAL_TRIGGER for TABLE1 '||
> 'AFTER INSERT '||
> 'POSITION 100 '||
> 'AS BEGIN '||
> 'EXECUTE PROCEDURE MY_PROCEDURE; '
> 'END';
>
> but when I try I get an ERROR.. very confusing, I think in semicolon.
>
> Any idea to do or really not possible to do?

You can't do it. If it let you it could end up corrupting the
database, so it doesn't let you.

http://groups.yahoo.com/group/firebird-support/message/68094

Answering a different question, the first part is not really relevant,
but they are doing something similar to you. Trying to nest some DDL
inside an Execute statement block.

<snip from Helen's post>
DON'T USE EXECUTE STATEMENT TO PERFORM DDL OPERATIONS
</snip>

I sense she doesn't think it is a good idea ;)

Adam


>