Ravindra76
asked on
Pass Array to oracle stored procedure (owa_util.ident_arr)
JDk : 1.3
Oracle Drivers : classes12.zip ( thin drivers Jdbc Type 4)
How to pass an array of strings to to the stored prcocedure with the PL/SQL data type owa_util.ident_arr ?
advacned thanks
Ooops sorry :-)
params.append("&yourArray= " + "elemnt(i) of yourArray");
instead of
params.append("&pServiceID =" + "elemnt(i) of yourArray");
Valeri
params.append("&yourArray=
instead of
params.append("&pServiceID
Valeri
ASKER
That's for the case of Web.
Won't work for noraml case..........
Won't work for noraml case..........
What does it means "That's for the case of Web." ?
Best Regards,
Valeri
Best Regards,
Valeri
ASKER
Ok. Finally i got the solution....... my self....
String s_arr[] = {"ravi","ramesh"};
ArrayDescriptor in_arr = ArrayDescriptor.createDesc riptor("T_ ARRAY", conn);
ARRAY arr = new ARRAY(in_arr,conn,s_arr);
cs = (OracleCallableStatement)c onn.prepar eCall("beg in p_ac_test(:1,:2,:3); end;" ) ;
cs.setARRAY(1,arr);
...
where T_ARRAY is the data type in PL/SQL
create or replace TYPE t_array IS varray(200) of varchar2(100)
/
String s_arr[] = {"ravi","ramesh"};
ArrayDescriptor in_arr = ArrayDescriptor.createDesc
ARRAY arr = new ARRAY(in_arr,conn,s_arr);
cs = (OracleCallableStatement)c
cs.setARRAY(1,arr);
...
where T_ARRAY is the data type in PL/SQL
create or replace TYPE t_array IS varray(200) of varchar2(100)
/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Any way deleting the question does not look good
PROCEDURE YourStoredProcedure(yourAr
IS
BEGIN
FOR idx IN 1..yourArray.COUNT LOOP
IF (yourArray(idx) IS NOT NULL) THEN
BEGIN
....
In your Java code you have to "collect" yourArray in this way :
private void memberParams(StringBuffer params) {
for (int i = 0; i < yourArray.size(); i++) {
params.append("&pServiceID
}
} //end of adMemberParams
I hope it will help you.
Best Regards,
Valeri