× 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.



Carel,

 Thanks for the reply. Yes, YDRC (you did recall correctly), DYNSQL came as
a V5R1 *SRVPGM and I could see the /EXEC commands as I stepped through with
the debugger.

 The important thing is that DYNSQL allows me to start using embedded SQL -
even if it is limited to V5R1 and is used for picayune things like count(*).
My main goal was to find whether DYNSQL lacks any major functionality as
compared with IBM's precompiler.

a) I don't anticipate needing more than 8 cursors open at one time and
assume that closing one cursor frees it up for another use. That shouldn't
be a problem as long as it is bound by the program's AG.

b) Right now I don't know enough to know whether metadata is important to me
so you've given me something else to google!

c) I believe that QMQRY objects cannot use the 'select' statement, as there
is no mechanism to return results to a calling program.

d) I've fiddled around with QSQPRCED a little - even wrote a *SRVPGM that
allows me to run a simple SQL command from RPG - but I became thoroughly
lost inside the SQLDA and ended up with something no better than QMQRY. 

 Our company's recent change of ownership adds a little urgency to my desire
to incorporate SQL into our legacy system. I want to be able to talk
intelligently to the new home office M$-SQL techies when they start the
systems evaluation in November.

 Question: am I correct in my understanding that the main difference between
dynamic and static SQL is that static SQL uses an already-prepared
statement, an *SQLPKG? And that the IBM precompiler simply creates and names
those *SQLPKG objects for you?

JK

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Carel Teijgeler
Sent: Friday, September 08, 2006 5:36 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: ISTKT & DYNSQL vs. 5722ST1 SQL Development Kit

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



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.