Problem in Retrieving An Array From Oracle Stored Procedure !
[ Follow Ups ] [ Post Followup ] [ Intranet eXchange ] [ IDM Home ]
Posted by Joe on May 22, 2002 at 9:5:36:
I am trying to return an array of char values from oracle (8.1.7) stored procedure to ASP. My procedure follows:create or replace type char_varray is varray(200) of char(15);
/
create or replace procedure getusers(username out nocopy char_varray) is
cursor users_cursor is
select username from users;
percount number default 1;
begin
username := char_varray();
for users_record in users_cursor loop
username.extend;
username(percount) := users_record.username;
percount := percount + 1;
end loop;
end;
/
I am able to get the array of values in SQL*Plus, but, NOT in ASP. The ASP code I use:
Set cmdStoredProc = Server.CreateObject("ADODB.Command")
Set cmdStoredProc.ActiveConnection = Conn ' a valid database connection
cmdStoredProc.CommandText = "getusers"
cmdStoredProc.CommandType = 4 'adCmdText
T = (&H2000 OR 129) 'adArray or adChar
set param = cmdStoredProc.createparameter("username", T, 2, 2000, "")
cmdStoredProc.parameters.append param
cmdStoredProc.Execute
When I load this page, I am getting the following error:
ADODB.Command error '800a0d5d'
Application uses a value of the wrong type for the current operation.
I am able to retrieve one single char value. NOT an array of char values. I use ADO 2.7.
Any help would be greatly appreciated.
Thanks.
Follow Ups:
[ Follow Ups ] [ Post Followup ] [ Intranet eXchange ] [ IDM Home ]