Hi, Steve,
You need this tool published in this article --
https://www.mcpressonline.com/programming/sql/using-dynamic-sql-in-cl-part-2retrieving-a-data-value
It provides a user written *CMD called LOOKUP that lets you retrieve a value from an SQL query in a CL program ... :-) (Look at the seventh paragraph for the two zip files to download.)
See also:
https://www.mcpressonline.com/programming/sql/using-dynamic-sql-in-cl-part-1running-action-queries
Thanks to Mike Sansoterra for these excellent articles and tools. :-)
Hope that helps,
Mark S. Waterbury
On Tuesday, March 9, 2021, 10:14:33 AM EST, Steve M via MIDRANGE-L <midrange-l@xxxxxxxxxxxxxxxxxx> wrote:
I guessed at which forum upon which to post - if this is not correct, please
let me know and I shall repost.
I know we can use RUNSQL within a CLLE to execute, typically, an Insert or
Delete or such. But I would like to receive a value back from my SQL.
Here is what I wish to execute: Select row_length from qsys2.systables
where table_schema = 'A' and table_name = 'B'.
I want to use the value returned from row_length inside my CLLE program.
Just like we can do inside of SQLRPGLE.
Is this possible to do? I find no examples, anywhere, of how to return a
value from an SQL within CLLE.
As always, thank you all for your time.
Steve Meisinger
This mailing list archive is Copyright 1997-2026 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.