|
Antonio, Here's the drum on how to create your own RUNSQL cmd for use in CLP. 1. Create a new RUNSQL mbr in srcfile QQMQRYSRC, enter a single line as follows and save it. &V1&V2&V3&V4&V5&V6&V7&V8&V9&V10 2. Create a *QMQRY object named RUNSQL from this source - CRTQMQRY QMQRY(QGPL/RUNSQL) 3. Create a CLP pgm named RUNSQL as follws. PGM PARM(&STMT) 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 &V1 %SST(&STMT 001 55) CHGVAR &V2 %SST(&STMT 056 55) CHGVAR &V3 %SST(&STMT 111 55) CHGVAR &V4 %SST(&STMT 166 55) CHGVAR &V5 %SST(&STMT 221 55) CHGVAR &V6 %SST(&STMT 276 55) CHGVAR &V7 %SST(&STMT 331 55) CHGVAR &V8 %SST(&STMT 386 55) CHGVAR &V9 %SST(&STMT 441 55) CHGVAR &V10 %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)) ENDPGM 4. Create a command named RUNSQL as follows CMD PROMPT('Run SQL Statement') PARM KWD(STMT) TYPE(*CHAR) LEN(550) I don't think there's any more to do Cheers, Peter -----Original Message----- From: Antonio Salazar [mailto:asm@kernel.com.mx] Sent: Wednesday, August 30, 2000 10:45 AM To: RPG400-L@midrange.com Subject: Re: Fw: File in CL Program I've been trying to do that, but as far as i knew, STRQMQRY can't run updates or deletes ¿How did you do it? ----- Original Message ----- From: "Peter Connell" <peterc@baycorp.co.nz> To: <RPG400-L@midrange.com> Sent: Tuesday, August 29, 2000 3:46 PM Subject: RE: Fw: File in CL Program > It's very simple to create a cmd that runs a simple QM/400 query which > expects to be passed a complete SQL statement. We use this in CLP to > dynamically run any SQL UPDATE statement. This feature has been available > for yonks, and there's almost nothing to code to make it available. You > don't need a hammer if you simply wish to use thumb tacks. > > Cheers, Peter +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- This communication is confidential and may be legally privileged. If it is not addressed to you, you are on notice of its status. Please immediately contact us at our cost and destroy it. Please do not use, disclose, copy, distribute or retain any of it without our authority - to do so could be a breach of confidence. Thank you for your co-operation. Please contact us on (09) 356 5800 if you need assistance. +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
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.