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



All,

Does anyone know if it's possible to simulate the PROCESS(*VLD)
interactive SQL option within a QMQRY? I have a dummy QMQRY which allows
you to run any SQL statement (you've probably seen it in one form or
another elsewhere):

QMQRYSRC:

&V1&V2&V3&V4&V5&V6&V7&V8&V9&V10

QCLSRC:

...
DCL        VAR(&STMT) TYPE(*CHAR) LEN(550)
DCL        VAR(&V1) TYPE(*CHAR) LEN(55) 
DCL        VAR(&V2) TYPE(*CHAR) LEN(55) 
DCL        VAR(&V3) TYPE(*CHAR) LEN(55) 
DCL        VAR(&V4) TYPE(*CHAR) LEN(55) 
DCL        VAR(&V5) TYPE(*CHAR) LEN(55) 
DCL        VAR(&V6) TYPE(*CHAR) LEN(55) 
DCL        VAR(&V7) TYPE(*CHAR) LEN(55) 
DCL        VAR(&V8) TYPE(*CHAR) LEN(55) 
DCL        VAR(&V9) TYPE(*CHAR) LEN(55) 
DCL        VAR(&V10) TYPE(*CHAR) LEN(55)
...
CHGVAR     VAR(&V1) VALUE(%SST(&STMT 001 55)) 
CHGVAR     VAR(&V2) VALUE(%SST(&STMT 056 55)) 
CHGVAR     VAR(&V3) VALUE(%SST(&STMT 111 55)) 
CHGVAR     VAR(&V4) VALUE(%SST(&STMT 166 55)) 
CHGVAR     VAR(&V5) VALUE(%SST(&STMT 221 55)) 
CHGVAR     VAR(&V6) VALUE(%SST(&STMT 276 55)) 
CHGVAR     VAR(&V7) VALUE(%SST(&STMT 331 55)) 
CHGVAR     VAR(&V8) VALUE(%SST(&STMT 386 55)) 
CHGVAR     VAR(&V9) VALUE(%SST(&STMT 441 55)) 
CHGVAR     VAR(&V10) VALUE(%SST(&STMT 496 55))
STRQMQRY   QMQRY(RUNSQL) +      
             SETVAR((V1 &V1) (V2 &V2) (V3 &V3) +
             (V4 &V4) (V5 &V5) (V6 &V6) +       
             (V7 &V7) (V8 &V8) (V9 &V9) +       
             (V10 &V10))
...                        

Anyway, I would like to be able to allow users to use this QMQRY not
just to run SQL statements, but to validate statements (not just
syntax-checking, but ensuring that any specified columns exist etc.). It
doesn't seem to be an option on the STRQMQRY command itself, and there
isn't (as far as I can see) the ability to specify this option as a 'V'
record in the QQMQRYSRC member (as you can to specify language and sort
sequence).

Anyone got any bright ideas?

TIA,

Rory


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.