|
Dear All, Thank you very much for responding to the query raised by me on "Running SQL command in a CLLE program". Actually, there was a requirement to execute SQL statements from CLLE program only just to avoid creating another object in the production library but later on this decision has changed since it was not giving much benefit to the solution. Regards, Rabin. ---------------------------------------------------------------------- message: 7 date: Wed, 18 Oct 2006 15:04:48 +0530 from: "Nandi, Rabindranath \(Cognizant\)" <Rabindranath.Nandi@xxxxxxxxxxxxx> subject: Running SQL command in a CLLE program Hi, Is there a way to execute SQL statements in a CLLE programs, other than the following? 1) QMQRY 2) RUNSQLSTM 3) Calling Embedded SQLRPG program in the CLLE program If it's not possible then please let me know Regards, Rabin. message: 9 date: Wed, 18 Oct 2006 15:11:11 +0200 from: "Hauser, Birgitta" <Birgitta.Hauser@xxxxxxxxxxx> subject: RE: Running SQL command in a CLLE program Hi, you also can use a QSH command: Here is an example: DCL VAR(&COMMAND) TYPE(*CHAR) LEN(256) + VALUE('db2 "Insert Into Hauser.TestQSH Values(') DCL VAR(&CMDEND) TYPE(*CHAR) LEN(10) VALUE(')"') DCL VAR(&Quote) TYPE(*CHAR) LEN(1) VALUE('''') DCL VAR(&Comma) TYPE(*CHAR) LEN(2) VALUE(', ') DCL VAR(&NAME) TYPE(*CHAR) LEN(10) VALUE('Birgitta') DCL VAR(&NUMBER) TYPE(*CHAR) LEN(5) VALUE('12345') DCL VAR(&MYDATE) TYPE(*CHAR) LEN(10) VALUE('2006-10-17') QSH CMD('db2 "Insert Into Hauser.TestQSH + Values(''Birgitta'', 12345, Default)"') CHGVAR VAR(&COMMAND) + VALUE(&Command *TCAT &Quote *TCAT &Name *TCAT &Quote + *TCAT &Comma *CAT &Number *TCAT &Comma + *CAT &Quote *TCAT &MyDate *TCAT &Quote + *TCAT &CmdEnd) QSH CMD(&Command) Mit freundlichen Gr??en i.A. Birgitta Hauser LUNZER + PARTNER GMBH Consulting | Software | Service Carl-Zeiss-Stra?e 1 63755 Alzenau Tel: + 49 6023 951-255 Fax: + 49 6023 951-111 Internet. www.lp-gmbh.com www.rpg-schulung.de -------------------------------------------------------- Handelsregister: Aschaffenburg HRB 4720 Gerichtsstand und Erf?llungsort Alzenau Ust-IdNr.: DE132093146 Gesch?ftsf?hrer: Rudolf Gerbert --------------------------------------------------------- from: Scott Klement <midrange-l@xxxxxxxxxxxxxxxx> subject: Re: Running SQL command in a CLLE program Hello, On Wed, 18 Oct 2006, "Nandi, Rabindranath \(Cognizant\)" wrote:
Is there a way to execute SQL statements in a CLLE programs, other
than
the following?
1) QMQRY
2) RUNSQLSTM
3) Calling Embedded SQLRPG program in the CLLE program
Lots of ways. a) You mentioned RPG, but didn't mention any of the other HLLs that can have SQL in them. C, COBOL, Java... b) Starting in V5R3, you can call the SQL CLI API directly from CL. c) You can call REXX from CL, and do the SQL in REXX. d) You can call QShell from CL, and do the SQL in QShell. This is just off the top of my head. I'm sure there are other ways that don't immediately come to mind. Why do you want to know this? ------------------------------------------------------------------------ -------------------------- This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful. Visit us at http://www.cognizant.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.