I have a specification to call a stored procedure which accepts a Table type as one of the parameters.
Is it possible to create this type of scenario within AcuCobol as a data structure that can be passed to the parameter
My current code looks like this and i get an “Invalid SQL data type”, when trying to call the procedure as i am using a temp table created on the database to pass to the procedure but this is not working.
MOVE "PAYDAY_TEMP" TO chvJournalName.
MOVE "01" TO chvVendorCode.
EXEC SQL declare spcursor10 cursor for
:ret-code = exec P_F_G_UPD_LEDGER_JOURNAL (
:chvJournalName,
:chvVendorCode
)
END-EXEC.
if SQLCODE < 0
perform error-exit
exit paragraph.
EXEC SQL
open spcursor10
END-EXEC.
if SQLCODE < 0
perform error-exit
exit paragraph.
move 0 to num-rows-read.
perform until SQLCODE not = 0
EXEC SQL
FETCH spcursor10 into
:chvReturnStatus,
:intBatchNumber,
:intRecordsReceived,
:intRecordsProcessed,
:intRecordsFailed
END-EXEC
if SQLCODE < 0
perform error-exit
exit perform
else
if sqlcode = 0
add 1 to num-rows-read
move intRecordsReceived to ws-intRecordsReceived
move intRecordsProcessed to ws-intRecordsProcessed
move intRecordsFailed to ws-intRecordsFailed
move spaces to ws-line
string
chvReturnStatus delimited by " "
" " delimited by size
intBatchNumber delimited by " "
" " delimited by size
ws-intRecordsReceived delimited by " "
" " delimited by size
ws-intRecordsProcessed delimited by " "
" " delimited by size
ws-intRecordsFailed delimited by " "
" " delimited by size
into ws-line
end-string
MODIFY FORM1-LB-1, ITEM-TO-ADD IS WS-LINE
end-if
end-if
end-perform.
The specification reads as follows for the stored procedure.
5.2.2 P_F_G_UPD_LEDGER_JOURNAL
This artefact exposes a table valued parameter for the 3rd Party Vendor to insert GL Journals into the staging table
in the SOLAR Integration database:
5.2.2.1 Input Parameter(s)
5.2.2.1.1 Payroll and Asset GL Integration Required Attributes
The following parameter(s) are required as input parameters to fulfil the purpose of the artefact:
Ledger Journal Table Type - ttLedgerJournal as Table
Vendor Code as VarChar(2)
The procedure will return the following values.
1 UNIQUE_IDENTIFIER BIGINT
2 FINANCIAL_PERIOD VARCHAR (6)
3 GL_TRANS_TYPE VARCHAR (2)
4 VENDOR_CODE` VARCHAR (2)
5 JOURNAL_REFERENCE VARCHAR (14)
6 JOURNAL_DESCRIPTION VARCHAR (60)
7 TRANSACTION_DATE INT
8 SCOA_FUNCTION_GUID VARCHAR (40)
9 SCOA_FUND_GUID VARCHAR (40)
10 SCOA_ITEM_GUID VARCHAR (40)11 SCOA_PROJECT_GUID VARCHAR (40)
12 SCOA_COST_GUID VARCHAR (40)
13 SCOA_REGION_GUID VARCHAR (40)
14 ENTITY_COST_CENTRE VARCHAR (10)
15 ENTITY_SUB_ITEM VARCHAR (10)
16 ENTITY_PROJECT VARCHAR (10)
17 DEBIT_AMOUNT
NUMERIC (25,
2)
18 CREDIT_AMOUNT
NUMERIC (25,
2)



