On 23-Jan-2015 10:38 -0600, Charles Wilt wrote:
Inside of a Net.Data macro, I need to lookup a value, save it
and then use it in the WHERE clause of some other queries.

Does SELECT INTO work in Net.Data?

So apparently the /lookup/ is the result of a SELECT, and the aim is to get the result values from a SELECT _into_ Net.Data global variables for reference in "other queries"? My SWAG:

I doubt the SELECT INTO would be allowed per not being allowed outside of embedded. However the VALUES INTO statement will, since the IBM i 7.1 SQL, allows for the /SQL Global Variable/ to accept the result of the row-fullselect. Any SQL GV can be obtained as a result column of a row-values clause [i.e. a values-clause producing a result-table] or a SELECT [from a one-row dummy table]; minimally, AFaIK, the latter enables $(Vn) variable references for which I expect that result value then can be assigned to a previously defined Net.Data global variable for use elsewhere [i.e. in other queries]. However one might suppose if that were possible, then a simple SELECT with FETCH FIRST clause asking for just 1 ROW ONLY should allow obtaining the $(Vn) to reach the same ends; directly obtaining the values without a need for any INTO syntax.?

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.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 on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.