• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

VARRAY is Stored Proc out param, throws exception ORA-06550

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have a stored procedure definiation as follows
procedure main(p_rma_varr in out rma_varr,
p_rma_locations_varr in out rma_locations_varr,
p_rma_repair in out rma_repair_detail_varr, p_rma_invoice_varr in out rma_invoice_varr, p_mode in varchar2,
retcode out number,errbuff out varchar2);
i have java code to register and load in out parameters as follows
StructDescriptor sd_rma = StructDescriptor.createDescriptor("RMA_V",con);
StructDescriptor sd_location = StructDescriptor.createDescriptor("RMA_LOCATIONS_V",con);
StructDescriptor sd_invoice = StructDescriptor.createDescriptor("RMA_INVOICE_V",con);
StructDescriptor sd_rep_det = StructDescriptor.createDescriptor("RMA_REPAIR_DETAIL_V",con);
STRUCT st_rma = new STRUCT(sd_rma,con,o_rma);
STRUCT st_location = new STRUCT(sd_location,con,o_location);
STRUCT st_invoice = new STRUCT(sd_invoice,con,o_invoice);
STRUCT st_rep_det = new STRUCT(sd_rep_det,con,o_rep_det);
CallableStatement cstmt = con.prepareCall("{call RMA_MAIN_PKG.main(?,?,?,?,?,?,?)}");
cstmt.setObject(1,st_rma);
cstmt.setObject(2,st_location);
cstmt.setObject(3,st_invoice);
cstmt.setObject(4,st_rep_det);
cstmt.setString(5,"insert");
cstmt.registerOutParamete(6,OracleTypes.NUMBER);
cstmt.registerOutParameter(7,OracleTypes.VARCHAR);

cstmt.registerOutParameter(1,OracleTypes.STRUCT,"RMA_V");
cstmt.registerOutParameter(2,OracleTypes.STRUCT,"RMA_LOCATIONS_V");
cstmt.registerOutParameter(3,OracleTypes.STRUCT,"RMA_INVOICE_V");
cstmt.registerOutParameter(4,OracleTypes.STRUCT,"RMA_REPAIR_DETAIL_V");
cstmt.execute();
Compiles fine, at execution throws exception saying ORA-06550 Line 1 Column 7:
PLS-00306: wrong number or types or arguments in call 'MAIN'
ORA-06550: line 1 Column 7
Any help .... appreciated in advance.
Thanks
Ajay
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have the same problem and it is too urgent.
Any help?
Thanks,
Samira
 
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Post the definition of "rma_varr" if it's VARRAY then use
ArrayDescriptor desc = ArrayDescriptor.createDescriptor("rma_varr", con);
ARRAY newArray = new ARRAY(sd_rma , con, o_rma);
also your out parameters are mixed types?
 
So it takes a day for light to pass through this glass? So this was yesterday's tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic