Array DML Error

hoyman

Member
Hi,

I receive the following error message when reopening the TOracleDataSet component:
"All arrays must be of equal size for Array DML"

My component (odsValues) calls a stored procedure that gets an array of identifiers as input and returns a cursor. Therefore I declared two variables:
1.Ids as PL/SQL Table of integer type
2.Res as cursor

When I execute the following statements:
odsValues.Close;
odsValues.SetVariable('Ids', myIds);
odsValues.Open;

(myIds is a array of integers containing identifiers)
this works fine and returns results, but when I reassign the variable value so that my code looks as follows:
odsValues.Close;
odsValues.SetVariable('Ids', myIds);
odsValues.Open;

odsValues.Close;
odsValues.SetVariable('Ids', myIds);
odsValues.Open;

this fails on second Open method call with the message "All arrays must be of equal size for Array DML".

Please help since this disqualifies the usage of your package in my application.

------------------
 
You need to declare the "Ids" variable as a PL/SQL Table. If you don't, the array value will be interpreted as the source for Array DML.

You can declare a PL/SQL Table at design time through the TOracleDataSet.Variables property editor, or at run-time through the TOracleDataSet.DimPLSQLTable procedure.

------------------
Marco Kalter
Allround Automations
 
Hi,

I did declared this variable as PL/SQL Table. Please note that my dataset is opened successfully and returns results when called first time. When I reopen the dataset and set the variable value again (does not matter whether identifiers array is exactly the same or other), this fails. Please see my code because it illustrates the problem properly.

Looking forward to receive your help.

------------------
 
Back
Top