MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » June 2014

Re: how to use the Select Distinct



fixed

IBM added a new command RUNSQL in V7r1 (in 2012 via ptf) and ptf'd it also into V6R1.
Infocenter has doc on how it works. This is not all the features of iNav or STRSQL..
http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Fsqlp%2Frbafyrunsql.htm

What IBM did not do is some new way to read files or result sets. But CLP has always had RCVF to read records in a file,
so the above link to the infocenter has this example

In a CL program, you could use the Receive File (RCVF) command to read the results of the table generated for this query:
RUNSQL SQL('CREATE TABLE qtemp.worktable AS
(SELECT * FROM qsys2.systables WHERE table_schema = ''MYSCHEMA'') WITH DATA')
COMMIT(*NONE) NAMING(*SQL)So I did a test RUNSQL SQL('create table qtemp.worktable as (select distinct bid from tran) with data') COMMIT(*NONE) and got a file Display Physical File Member File . . . . . . : WORKTABLE Library . . . . : QTEMPMember . . . . . : WORKTABLE Record . . . . . : 1 Control . . . . . Column . . . . . : 1 Find . . . . . . . *...+. A.A50 A&A44 A&A75 A&B60 A-A50 A-112 AAC25 Read the InfoCenter link above for all the limitations. Jim Franz ----- Original Message ----- From: "Hoteltravelfundotcom" <hoteltravelfun@xxxxxxxxx>
To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
Sent: Sunday, June 01, 2014 7:02 PM
Subject: how to use the Select Distinct





Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact