× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I recently received the following email from a coworker, I am seeking higher knowledge:


I am not using 'cursors'...

My statements are such as:

Exec Sql
INSERT into NSIRECDTA
WITH InScope (mldct, mlglpt, mlco, mlobj, mlsub)
AS
(select b.mldct, b.mlglpt, b.mlco, b.mlobj, b.mlsub
from nsiscope a
join F4095 b
on a.nsiobj = b.mlobj
and a.nsisub = b.mlsub
where b.mlCO = '00000'
group by b.mldct, b.mlglpt, b.mlco, b.mlobj, b.mlsub )
(select DISTINCT
sdDOCO as ndTDOC,
sdDCTO as ndTDCT,
sdKCOO as ndTCO,
cast((0) as numeric (8,0)) ndRDOC,
cast(' ' as char(2)) ndRDCT,
cast(' ' as char(5)) ndRCO,
glDOC as ndLDOC,
glDCT as ndLDCT,
glKCO as ndLCO,
cast((0) as numeric (7,1)) ndJELN,
cast((0) as numeric (8,0)) ndAA,
cast(' ' as char(12)) ndMCU,
cast(' ' as char(6)) ndOBJ,
cast(' ' as char(8)) ndSUB,
cast((0) as numeric (6,0)) ndDGJ,
cast(' ' as char(30)) nddesc,
cast(' ' as char(3)) ndRCD,
cast(' ' as char(1)) ndRCND,
:BatchNumber as ndICU,
(:counterNEW +1) as ndCNT,
User as ndUSER,
:ProgramID as ndPID,
cast('NSI0801-01' as char(10)) ndJOBN,
:$upmj as ndUPMJ,
current Date ,
current Time
from F0911
Join InScope e
on glDCTO = e.mlDCT
and glOBJ = e.mlOBJ
and glSUB = e.mlSUB
join F42119
on glKCO = sdKCO
and glDCT = sdDCT
and glDOC = sdDOC
Where e.mlCO = '00000'
and sdKCO = :inKCO
and sdDCT = :inDCT
and sdDOC = :inDOC
AND (sdDOCO, sdDCTO, sdKCOO, glDOC, glDCT, glKCO)
NOT IN(
Select ndTDOC, ndTDCT, ndTCO, ndLDOC, ndLDCT, ndLCO
from NSIRECDTA));



My source is :
MDMDEV/QRPGLESRC/NSI0801
MDMDEV/QRPGLESRC/NSI0801SQL - Tony's suggestion was to move all of the SQL statements into another module, so that the calling module, NSI0801, would execute the SQL, then NSI0801SQL turns on *inLR, so that the files would be closed each time.

In her next email she asked:

Should I be using 'cursors' instead?

We are on V7R2.

Thanks In Advance,

Danny

"This e-mail and any attachments, contain Genuine Parts Company confidential information that is proprietary, privileged, and protected by applicable laws. If you have received this message in error and are not the intended recipient, you should not retain, distribute, disclose or use any of this information and you should destroy this e-mail, any attachments or copies therein forthwith. Please notify the sender immediately by e-mail if you have received this e-mail in error."

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.