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



On one thought I find I don't agree - I know that the general-purpose SQL processor I built was not to get around not being able to do embedded SQL, since we always had that capability wherever I was.

My purpose was to do SQL at a command line, and especially to get ad hoc reports easily. It wasn't meant to return anything to the program using the command. The latter is a nice feature, of course.

IBM's RUNSQL gives us the ability to do any statement other than SELECT - the various QM-based commands let us do SELECTs as well as DDL functions like INSERT and the various CREATEs, etc. And I've thought that using CREATE TABLE with a SELECT doesn't make it if what I want is a display of data or a report of it.

And the reporting ability and output options of STRQMQRY are a part of a more complete version of these utilities, some capabilities that IBM's RUNSQL can't do, either.

Regards
Vern

On 2/22/2018 5:05 AM, Lynne Noll wrote:
-snip-


However, the main purpose of the QMQRY utilities was getting around the lack of purchased SQL tools like embedded SQL in RPG.

-snip-



Sent from Outlook<http://aka.ms/weboutlook>


________________________________
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxx> on behalf of Vernon Hamberg <vhamberg@xxxxxxxxxxxxxxx>
Sent: Wednesday, February 21, 2018 8:37 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Converting QM Query to rpg embedded SQL

To expand a little on Lynne's explanation, it is possible to have a
QMQRY string like this - &Q1&Q2&Q3&Q4&Q5 - this would allow an SQL
statement up to 275 characters long, since each substitution variable
can be at most 55 long. This is the basis of almost all the utilities
people have made (Buck Calabro had one I made a variation of, and
others) that can run any SQL statement, including SELECTs (IBM's RUNSQL
does not directly run SELECT statements). The statement is broken up
into 55-character variables and passed in the SETVAR parameter of
STRQMQRY, which combines them into the statement, as Lynne describes.

I have a presentation and lab I present at COMMON about QM - usually the
lab is all we put on the schedule these days.

Regards
Vern


--



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.