MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » February 2013

SQL Trigger Body using "CLASS"



fixed

I have the following body to a trigger. It doesn't work anymore. "CLASS" is now a reserved word. I have "CLASS" as a field name (column name) in all the tables involved in the trigger body. Any ideas how I can make this work without changing the field name in all the tables? The trigger is after insert on workpiececlasscolumns.


BEGIN ATOMIC
DELETE FROM RJSFLOW . WORKPIECECLASSCOLUMNSLINKED WHERE RJSFLOW . WORKPIECECLASSCOLUMNSLINKED . CLASS = NEW_ROW . CLASS ;

INSERT INTO RJSFLOW . WORKPIECECLASSCOLUMNSLINKED ( CLASS , N1 , N2 , N3 )
( SELECT CLASS . CLASS , N1 . NEXTVALUENAME , N2 . NEXTVALUENAME , N3 . NEXTVALUENAME FROM RJSFLOW . WORKPIECECLASS CLASS
LEFT JOIN RJSFLOW . WORKPIECECLASSCOLUMNS N1 ON CLASS . CLASS = N1 . CLASS AND N1 . VALUENAME = ''
LEFT JOIN RJSFLOW . WORKPIECECLASSCOLUMNS N2 ON CLASS . CLASS = N2 . CLASS AND N2 . VALUENAME = N1 . NEXTVALUENAME
LEFT JOIN RJSFLOW . WORKPIECECLASSCOLUMNS N3 ON CLASS . CLASS = N3 . CLASS AND N3 . VALUENAME = N2 . NEXTVALUENAME
WHERE CLASS . CLASS = NEW_ROW . CLASS ) ;
END

______________________________________________________________________________________________________________
Dan Kimmel | Workflow Guru | RJS Software Systems
2970 Judicial Road, Suite 100 | Burnsville, MN 55337 | *: 952-736-5800 | *: dkimmel@xxxxxxxxxxxxxxx<mailto:dkimmel@xxxxxxxxxxxxxxx>
[cid:907235719@05022013-183D]<http://www.rjssoftware.com/>[cid:907235719@05022013-1844]<mailto:http://blogs.rjssoftware.com/rjsinformer/index.php/feed/>[cid:907235719@05022013-184B]<http://www.facebook.com/?ref=home#!/pages/RJS-Software-Systems/124687644237867?ref=ts>[cid:907235719@05022013-1852]<http://twitter.com/rjssoft>[cid:907235719@05022013-1859]<http://www.linkedin.com/companies/rjs-software-systems>[cid:907235719@05022013-1860]<http://www.youtube.com/user/RJSSoftwareSystems>
Manage the entire lifecycle of your business information






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact