|
Mary, I believe you need to put your sql statement in a text file(for example MARYSQL and then in your CL program(MARYSQLCL), you need to run something like this. RUNSQLSTM SRCFILE(YOURLIB/QCLSRC) SRCMBR(MARYSQL) + COMMIT(*NONE) Mike -----Original Message----- From: Kern, Mary T [mailto:MKern4@xxxxxxxxxxxxxxxxx] Sent: Tuesday, December 16, 2003 1:08 PM To: Midrange-L (Midrange-L) Subject: SQL works interactively but not in CL Any idea why this will work interactively but not in a CL program? I can't see a problem. The error in the CL is: Keyword WHERE not expected. Valid tokens: , FROM INTO. RUN QUERY command failed with SQLCODE -199. Here is the interactive statement: UPDATE drpp010 set drpcmm = 12, drpcdd = 15, drpccc = 20, drpcyy = 03, drpctt = 0, drptmm = 12, drptdd = 15, drptcc = 20, drptyy = 03, drpcus = 'UTFERPA' WHERE drpcde = 'DR' and drptyp = 'FRP' and drptmm = 0 and drptdd = 0 and mstid in (select mstid from amrp020 where amests <> 1 and amests <> 2 and amcmbr = 'Y') Here is the EVAL from the DEBUG: ....5...10...15...20...25...30...35...40...45...50...55...60 1 'UPDATE drpp010 set drpcmm = 12, drpcdd = 16, drpccc = 20, dr' 61 'pcyy = 03, drpctt = 0, drptmm = 12, drptdd = 16, drptcc = 20' 121 ', drptyy = 03, drpcus = 'UTFERPA' WHERE drpcde = 'DR' and dr' 181 'ptyp = 'FRP' and drptmm = 0 and drptdd = 0 and mstid in (sel' 241 'ect mstid from amrp020 where amests <> 1 and amests <> 2 and' 301 ' amcmbr = 'Y') Thanks! Mary ¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥« Mary Kern Director of Information Services University of Toledo Foundation 2801 W Bancroft St Mail Stop 319 Toledo, OH 43606 Voice: (419) 530-7730 (800) 640-0147 Fax: 419-530-2895 Email: mary.kern4@xxxxxxxxxxx Christmas waves a magic wand over this world, and behold, everything is softer and more beautiful. --Norman Vincent Peale ¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»«¤»¥« _______________________________________________ This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
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.