Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Stored Proc - Array Param
Hello,
Yes, I tried binding with number and integer, types 2 and 3 (sqlt_num & sqlt_int). Here is the error I get back:
ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to ''P_ARRAY'' ORA-06550: line 1, column 7:
. . . the pl/sql block looks like the following:
'begin p_array(:arr); end;'
. . . and the params to the bind call are the following (pardon the
smalltalk but I think it is understandable, strings are enclosed using
single quotes):
paramArray := Array new: 14.
paramArray
at: 1 put: stmthp; " Statement Handle " at: 2 put: bindPtr; " An address of a bind handle " at: 3 put: connection errhp; " Error Handle " at: 4 put: ':arr'; " Position " at: 5 put: ':arr' size; " Special value for PL/SQL Binding" at: 6 put: dataPtr; " An Address of a data value " at: 7 put: 4; " The size of the data value " at: 8 put: dataType; " The data type of the value being bound " at: 9 put: 0; " Pointer to an indicator variable or array " at: 10 put: 0; " Pointer to array of actual lengths of array elements" at: 11 put: 0; "Pointer to array of column level return codes " at: 12 put: 0; " Not required for non-PL/SQL binds " at: 13 put: 0; " Only required for PL/SQLbinds "
. . . the dataPtr is allocated memory, 12 bytes. At positon 12, of the
above params, I also tried a '3' to indicate the array was 3 positions long.
The dataType (position 8 above) tried was sqlt_num and sqlt_int.
I found a demo 'c' file that does something like this but it uses obsolete calls.
Any ideas on what I am doing wrong?
Thanks.
-g Received on Wed May 31 2006 - 10:32:58 CDT