|
Hi, Instead of RUNSQLSTM you could use STRQMQRY (which supports *PRINT/*OUTFILE), but this has nothing to do with RPG offcourse. Kind regards, Paul -----Original Message----- From: Buck Calabro [mailto:Buck.Calabro@commsoft.net] Sent: 25 April, 2002 15:34 To: rpg400-l@midrange.com Subject: RE: Outputting SQL results to spooled-file Gerry Tucker wrote: >In Interactive SQL you change session >attributes to output the results >from a select statement to a spooled file. >Is there anyway programatically to do >this so if I run RUNSQLSTM or in an RPG >IV program to get the same effect? RUNSQLSTM (IBM's anyway) doesn't allow SELECT statements, so I'm unsure what exactly you want to see printed. As for embedded RPG, just do a fetch and print the line as if you did a READ. Perhaps I misunderstand the question (it won't be the first time!) C/EXEC SQL C+ DECLARE Standings CURSOR FOR C+ Select CNNM,DVNM,TMNM,TMPT,TMID C+ from CONFERENCE,DIVISION,TEAM C+ where TMDVID=DVID and DVCNID=CNID C+ order by 4 desc,3 C/END-EXEC C/EXEC SQL C+ OPEN Standings C/END-EXEC C/EXEC SQL C+ FETCH Standings INTO C+ :CNNM,:DVNM,:TMNM,:TMPT,:TMID C/END-EXEC c except prtStand --buck _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. ------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it. ==============================================================================
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.