Skip to main content

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

  • June 17, 2012
  • 0 replies
  • 0 views

[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 replies

Be the first to reply!