Highlighted
Absent Member.
Absent Member.
567 views

[archive] PL/SQL Bulk Collect in Acucobol-GT

[Migrated content. Thread originally posted on 08 February 2007]

Has anyone been able to successfully embed a Bulk Collect PL/SQL statement into an AcuCobol-GT program? This code generates a precompiler error:

Working Storage:
EXEC SQL
BEGIN DECLARE SECTION
END-EXEC.

01 ARRAY-GROUP-LEVEL-NAME.
02 ACCT-NO-ROW OCCURS 10.
03 ACCT-NO PIC X(10).

EXEC SQL
END DECLARE SECTION
END-EXEC.

Procedure:
exec sql execute
BEGIN
SELECT ACCT_NO
BULK COLLECT INTO :ARRAY-GROUP-LEVEL-NAME
FROM ABC-TABLE
WHERE AR_APN = :DB-SEARCH-ITEM
END;
end-exec;

Error:
PCB-S-00204, Group item ARRAY-GROUP-LEVEL-NAME cannot be used except in INTO or VALUES clause

If I use the item level variable ACCT-NO it gives me a different error saying to use a GROUP item.

I've written and rewritten this a hundred times trying everything.

Anyone?

Thanks,
JC
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.