Reader Feedback and Insights: Overlooking the Obvious
November 8, 2002 Timothy Prickett Morgan
I have been following the SQL tips in Midrange Guru (“SQL to the Rescue!” and “SQL’s One-Row, One-Column Table“) that use a one-row, one-column table to execute SQL functions.
There’s an easier way.
Use the SET statement instead.
The following code is equivalent to the first tip on this subject, which was published in the October 25 issue.
d found s 1 d field1 s 5u 0 inz(5) d field2 s 5u 0 inz(15) d field3 s 5u 0 inz(30) C/EXEC SQL C+ set :found = C+ case when max(:field1, :field2, :field3) > 25