Re: Stored procedures
Posted in 1996
Mark D. Stock wrote: > > Jack Parker wrote: > > > A previous post mentioned Micheal Gonzales book on Stored Procedures. > > Here is some other stuff that should be added to the FAQ - some of which > > is direct learning (i.e. ripoff) from Micheal. <SNIP> > > 4 - They are nice to do recursion like when you want to explode a > > bill of materials. Something that 4gl cannot do. <SNIP> > Yes. You miss-spelled 'can' in point 4, it does not end in 'not'. ;-) > 4GL functions do support recursion, and I have used 4GL to print bill of > material type reports. > > My rule for 4GL has always been: > > If it's related to a database, 4GL can do anything. Mark, yes, 4GL has no trouble with recursion. However, SPL has big trouble with recursion. There is a documented restriction on triggers and any stored procedures they call: You cannot reference a triggering column in the trigger action. This means that if I have an update trigger on "emp.salary", niether the trigger action nor the proc it calls are permitted to reference column salary [in that same table/column. This restiction holds even if I want to reference this column on another row. I *know*! I deliberately tried it, hiding the behavior in two layers of SPL. It caught me! (Kinda like having the store guard stop you when you walk out the frint door.) This effectively precludes any attempt to write a trigger to implement some aspects of parts explosion. If this restriction has been relaxed in 7.2, I have not heard of it. -- Jake Salomon