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



I've created a utility that consists of a command and an RPG program that
processes an SQL command.  It's mostly for use in CL programs when a CPYF
won't do and, as much as I loved OPNQRYF "back in the day", I've moved on to
SQL.  The problem with SQL in a CL program is that RUNSQLSTM requires the
statement to be in a separate source file, which just always bugged the h*ll
out of me.  I know about the other non-IBM utility that passes the SQL
statement in parameter pieces to feed a qmqry, but that maxxed out at a 550
length statement.  When I was in the middle of modifying that to lengthen
it, someone on this list or midrange-l suggested using embedded SQL in RPG:
Execute Immediate.  This has worked great.  And, look ma!, no weird string
manipulation!

It works great, but there's a feature I'd really like to incorporate to make
it complete.  Currently, I do this:
   If SQLStt <> '00000';
     Dump(A) 'Open';
   Endif;
right after the Execute Immediate :SQLstmt.  I would like to throw back to
the calling application any messages that would appear as you'd see if you
were running from within STRSQL (interactive SQL).  This would include
errors and warnings, of course, but also informational messages, like "99
rows inserted in FILE in LIBRARY" messages.  "Throwing back to the calling
application" means that the message(s) would appear in the job log and on
the display's status line (if running interactively).

I was sure I'd find something in the archives to help me avoid having to
reinvent the wheel, but I gave up after combing through 20 or so threads.  I
know how to use the QMHSNDPM API, but how do I pick up the specific SQL
messages (and their data) to spit back through the API?

TIA,
Dan

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.