"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx> wrote on 01/26/2018
07:08:30 AM:
Are you saying this cursor,
which has the library qualified into it,
should somehow be using current schema?

Declare Company_Cursor Sensitive Cursor
for Select ORGANIZATION_KEY, STATUS, LIBRARY_NAME
From SHR460/CILCINFV03
Order by CIORGKY;


No, that cursor is working fine. It retrieves the library name
assigned to each of the ~600 companies we support. The "failure" comes in
the following statements--which yield expected results for the first two
columns of the temporary table, but the last column has the same count in
all temporary table rows. It is as if the Set Schema does nothing for the
Select Count(*) statement following it.

IF CompanyStatus IN ('Active','Inactive')
And CompanyLibrary > ' ' Then
Set Schema = CompanyLibrary;
Select Count(*) into RowCount from IM02T;
Insert into QTEMP/DLC_TEMP_TABLE
Values(CompanyNumber, 'IM02T', RowCount);
End If;


Sincerely,

Dave Clark

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.