Hello Gabor,

>>> First question: why do you have an UPDATE <table1> in a BEFORE UPDATE
>> trigger on <table1>?
>>
>>The table have many fields and a UNIQUE constraint with four fields, one
>>the ISDEFAULT from it (only one default accepted for groups of rows
>>depend on the other three fields (which included also in the UNIQUE)
>>value). If the user change the default row to not default and set other
>>to default in the application I need to set the old default row to not
>>default because if not do before set the new default the UPDATE violate
>>the UNIQUE.
>
>
>I agree with Dimitry, you might want to revise this design. If you have a
>table with a single value and a reference to this table, there can be only 
>1 default
>row, by design.
>
>Removing a row from this table and inserting a new one (or updating the old 
>row),
>would then always have a single row assigned to be the default and avoids
>the recursive trigger.

Alternatively, make this part of the trigger only fire when ISDEFAULT = T,
then you can safely set ISDEFAULT to 'F' from within the trigger.


With regards,

Martijn Tonies
Upscene Productions
http://www.upscene.com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird! 



------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

Reply via email to