ho una stored procedure in DB2Come chiamata di stored procedure prendendo array utilizzando ODBC: param_query in Erlang
create type intArray as integer array[100]@
create or replace procedure sum(in numList intArray, out total integer)
begin
declare i, n integer;
set n = CARDINALITY(numList);
set i = 1;
set total = 100;
while (i <= n) do
set total = total + numList[i];
set i = i + 1;
end while;
[email protected]
sto provando a chiamare attraverso Erlang ODBC: param_query.
odbc:param_query(Ref, "CALL sum (?, ?)", [{sql_integer,[1]}, {sql_integer,out, [1]}]).
È possibile che questo mi sta dando una corretta ritorno come
{executed,1,[{101}]}
Ma quando mi passa più valori come
odbc:param_query(Ref, "CALL sum (?, ?)", [{sql_integer,[1,2,3,4]}, {sql_integer,out, [1]}]).
E 'un'eccezione
uscita eccezione: {badarg, odbc, param_query, 'Params'} in funzione odbc: decode/1 (odbc.erl, riga 894)
C'è un altro modo per passare un elenco (matrice) alla stored procedure?