Subject | RE: [ib-support] Trigger name inside trigger code |
---|---|
Author | Martijn Tonies |
Post date | 2002-01-03T13:50:36Z |
Hi,
well, I cannot think of another way than calling a stored procedure with the
tablename and trigger name from the trigger. You cannot get the current
trigger or tablename via some build in function.
You could use, for example, only the trigger name and use the RDB$TRIGGERS
table to get the tablename in the procedure - but that's about as far as it
goes I think... :(
You made me think about an idea though -- with InterBase Workbench, whenever
you create a new trigger, a template is applied to the code (for example,
with user name, db name, date etc). I'll add the variables %TABLE% in it so
it will automatically enter the table name -- at least that takes some work
out of your hands :)
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com
We have special table for persistent connection information and in this
table we can write e.g. TABLENAME..., but we don`t know it.
Mira
Ing. Miroslav Slavík
TICKETPRO, a.s.
Salvátorská 10
110 01 Praha 1
mail: slavik@...
tel: +420 2 24814020
Mira
[Non-text portions of this message have been removed]
well, I cannot think of another way than calling a stored procedure with the
tablename and trigger name from the trigger. You cannot get the current
trigger or tablename via some build in function.
You could use, for example, only the trigger name and use the RDB$TRIGGERS
table to get the tablename in the procedure - but that's about as far as it
goes I think... :(
You made me think about an idea though -- with InterBase Workbench, whenever
you create a new trigger, a template is applied to the code (for example,
with user name, db name, date etc). I'll add the variables %TABLE% in it so
it will automatically enter the table name -- at least that takes some work
out of your hands :)
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com
> >We use exeptions in IB/FB. We try find effective way(reusable piece ofYes. I know it.
> code)
> >to tell application more information about exeption.
> >We know alternative way -> insert special code into each trigger(we have
> >more then 500 triggers).
>
> But you can't change the exception text while raising an exception, right?
We have special table for persistent connection information and in this
table we can write e.g. TABLENAME..., but we don`t know it.
Mira
Ing. Miroslav Slavík
TICKETPRO, a.s.
Salvátorská 10
110 01 Praha 1
mail: slavik@...
tel: +420 2 24814020
Mira
[Non-text portions of this message have been removed]