Subject | RES: [firebird-support] Re: problem creating trigger FB 1.5 |
---|---|
Author | Fabiano |
Post date | 2011-11-16T16:14:05Z |
I think this is a Bug corrected in Firebird 2.5.1!
I read something about it on release notes of FB 2.5.1
Sorry my poor english
-----Mensagem original-----
De: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] Em nome de Bart Smissaert
Enviada em: quarta-feira, 16 de novembro de 2011 14:12
Para: firebird-support@yahoogroups.com
Assunto: Re: [firebird-support] Re: problem creating trigger FB 1.5
Ignore this.
Have managed to create the triggers now and they are working fine.
RBS
On Wed, Nov 16, 2011 at 2:20 PM, Bart Smissaert
<bart.smissaert@...>wrote:
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links
I read something about it on release notes of FB 2.5.1
Sorry my poor english
-----Mensagem original-----
De: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] Em nome de Bart Smissaert
Enviada em: quarta-feira, 16 de novembro de 2011 14:12
Para: firebird-support@yahoogroups.com
Assunto: Re: [firebird-support] Re: problem creating trigger FB 1.5
Ignore this.
Have managed to create the triggers now and they are working fine.
RBS
On Wed, Nov 16, 2011 at 2:20 PM, Bart Smissaert
<bart.smissaert@...>wrote:
> This should work:<bart.smissaert@...>wrote:
>
> CREATE TRIGGER EXTENDED_TEXT_ADD FOR EXTENDED_TEXT ACTIVE BEFORE
> INSERT POSITION 10 AS
> begin
> insert into audit_trail
> values (null, null, null, 45, 0,
> new.Extended_Text_Type||"|"|| new.Foreign_Id||"|"||
> new.Extended_Text_Sequence_No,
> null,
> null
> );
> END
>
> But sofar not managed to do it via Database WB.
> If I do this with the trigger editor I can't set the trigger name to
> EXTENDED_TEXT_ADD
> and if I do with the SQL editor and run the statement as above I get:
> unsuccessful metadata update DEFINE TRIGGER failed attempt to store
> duplicate value
> (visible to active transactions) in unique index RDB$INDEX_8.
> Trigger editor allows me to create the trigger, but the trigger name then
> will be
> EXTENDED_TEXT_
> How to set the trigger name?
>
> Any suggestions?
>
> RBS
>
>
>
> On Wed, Nov 16, 2011 at 9:27 AM, Bart Smissaert
><ts@...>wrote:
>> I don't know those values.
>> Not sure now how they are inserted, audit_id will be via a generator.
>>
>> RBS
>>
>>
>>
>> On Wed, Nov 16, 2011 at 9:15 AM, Thomas Steinmaurer
>>[Non-text portions of this message have been removed]
>>> **
>>>
>>>
>>> > Actually, I suppose I could do:
>>> >
>>> > CREATE TRIGGER EXTENDED_TEXT_DEL FOR EXTENDED_TEXT
>>> > ACTIVE BEFORE DELETE
>>> > POSITION 10
>>> > AS
>>> > begin
>>> > insert into audit_trail
>>> > values (null, null, null, 45, 1,
>>> > old.Extended_Text_Type||"|"||
>>> > old.Foreign_Id||"|"||
>>> > old.Extended_Text_Sequence_No,
>>> > old.Extended_Text_Type||"|"||
>>> > old.Foreign_Id||"|"||
>>> > old.Extended_Text_Sequence_No||"|"||
>>> > old.Free_Text, null
>>> > );
>>> > END
>>> >
>>> > replacing the missing fields with null.
>>> > Should that work?
>>>
>>> Why not providing real values if you know them instead of null?
>>>
>>>
>>> --
>>> With regards,
>>> Thomas Steinmaurer
>>>
>>> * Upscene Productions - Database Tools for Developers
>>> http://www.upscene.com/
>>>
>>> * My Blog
>>> http://blog.upscene.com/thomas/index.php
>>>
>>> * Firebird Foundation Committee Member
>>> http://www.firebirdsql.org/en/firebird-foundation/
>>>
>>>
>>>
>>
>>
>
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links