× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



IIRC, DYNSQL is a SRVPGM with embedded SQL, so I assume you have a compiled
object. If you want metadata on the result set (sort of SQL DESCRIBE), it
may let you down with calculated fields, as it uses the SYSCOLUMNS LF,
which will not return. The maximum number of cursors (or active SQL
statements) is 8. 

I have not used it, only looked at it many moons ago. I wrote my own
dynamic SQL utilty instead.

Other options:  
1) You can create QMQRY objects with SQL statements in a SRCPF and the
CRTQMQRY command. Then run the QMQRY with STRQMQRY. You can pass parameters
to the query for dynamic data selection. This can be wrapped in a CLP with
a command interface. 
2) You can use the QSQPRCED API. Midrange Computing had an interesting
article on it, search the website www.mcpressonline.com.

Regards,
Carel Teijgeler 

*********** REPLY SEPARATOR  ***********

On 8-9-2006 at 13:11 JK wrote:

Our iSeries shop is small, with an even smaller software budget so
purchasing the IBM SQL precompiler (5722ST1) simply isn't going to happen.
We've muddled by with OPNQRYF and ASC's "Sequel" product (which is a great
tool) but without the ability to embed 'Select' statements into RPG or CL,
we've not been able to take full advantage of SQL.

Until yesterday, that is, when I girded my loins, plunged into that scary
SourceForge site, imported the "iSeries toolkit" and stayed up past
midnight playing with DYNSQL.

It appears that DYNSQL will enable me to build dynamic SQL statements,
declare cursors and fetch results directly into RPG and CL. What more could
a guy want? DYNSQL requires a slightly different syntax than IBM's
precompiler, but those are just technical details, right?

So I'd like to:
1) say thanks to David Morris and his compadres for making this available,
and
2) ask whether anyone else has used DYNSQL instead of IBM's offering and
what differences I should be aware of (other than syntax) between the two
products. The goal is not to chuck all the native I/O, but to enhance it
where the payback is greatest. Count(*) and Sum(amount) now become easy, as
well as dynamic sorting and filtering of subfiles. 



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2024 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.