4gl Coding Practice, prep, decl, foreach
Posted in 1995
I have a "4GL coding situation" that I need some feedback on. Normally the following is coded: prepare sqlid from "select a, b, c from anytable" declare sqlcur cursor for sqlid foreach sqlcur into wkA, wkB, wkC end foreach Usually, the (a, b, c) in the select matches the (wkA, wkB, wkC) in the foreach. What I want to do is this: prepare sqlid from "select a, b, c from anytable order by b,c" declare sqlcur cursor for sqlid foreach sqlcur into wkA end foreach I have some complied subroutines where a "prepare string" is passed into the routine. The routine has only picked up one variable from a select statement. I ONLY NEED/USE the first variable. The extra values on the select are only for sorting. THIS WORKS FINE "NOW" in 4gl. You DO NOT have to put all of the values on the foreach. I am concerned about this breaking at some time in the future. Any comments? -- Michael J. Kuhn Computer Systems Consultant phone:410-254-7060 Email: mkuhn@csd.clark.net mkuhn@rhlab.com or mkuhn%rhlab@uunet.uu.net or uunet!rhlab!mkuhn c/o Baltimore Rh Typing Laboratory, Inc. phone:410-225-9595