Hi,
 
Exercise in SQL for all....
 
Is there a better way to phrase this INSERT trigger text:
 
 
UPDATE ITEM
SET 

        ITEM_SGT=   ifnull(ITEM_SGT,(SELECT SGT FROM SETUP))  ,
        ITEM_EGT =  ifnull(ITEM_EGT,(SELECT EGT FROM SETUP)),
        ITEM_SGT_MODE =  ifnull(ITEM__AUTO_SGT_MODE,(SELECT SGT_MODE
FROM SETUP))    ,
        ITEM_EGT_MODE =  ifnull(ITEM_AUTO_EGT_MODE,(SELECT EGT_MODE FROM
SETUP))

WHERE ITEM__ID = NEW.ITEM__ID;
 
 
explanation: SETUP is a configurable table of defaults with a single row
of values
- when a row in inserted to ITEM - we want the trigger to populate the
default values if they have not been set by INSERT.
 
Eliedaat 
 
*********************************************************************************************************
This e-mail is confidential, the property of NDS Ltd and intended for the 
addressee only.  Any dissemination, copying or distribution of this message or 
any attachments by anyone other than the intended recipient is strictly 
prohibited.  If you have received this message in error, please immediately 
notify the [EMAIL PROTECTED] and destroy the original message.  Messages sent 
to and from NDS may be monitored.  NDS cannot guarantee any message delivery 
method is secure or error-free.  Information could be intercepted, corrupted, 
lost, destroyed, arrive late or incomplete, or contain viruses.  We do not 
accept responsibility for any errors or omissions in this message and/or 
attachment that arise as a result of transmission.  You should carry out your 
own virus checks before opening any attachment.  Any views or opinions 
presented are solely those of the author and do not necessarily represent those 
of NDS.

NDS Limited Registered office: One Heathrow Boulevard, 286 Bath Road, West 
Drayton, Middlesex, UB7 0DQ, United Kingdom. A company registered in England 
and Wales  Registered no. 3080780   VAT no. GB 603 8808 40-00

To protect the environment please do not print this e-mail unless necessary.
**********************************************************************************************************

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to