A parameter type is defined as an array in a stored procedure

Source: Internet
Author: User

Stored Procedures

ProcedureUPDATE_BATCH_ID (p_entity_idinch  Number, p_vdr_idinchFnd_table_of_number) is  begin     forIinch 1.. p_vdr_id.COUNTLoopUpdatecux_table_header CVSSetCvs.attribute10=p_entity_idwherecvs.header_id=p_vdr_id (i); EndLoop; End;

Called in Java

New ArrayList ();.. list.add (Row.getheaderid ());

Oraclecallablestatement statement = null;
OracleConnection OracleConnection = (oracleconnection) tsn.getjdbcconnection ();

int size = list.size ();

if(size>0) {number[] Vdridarray= (number[]) List.toarray (NewNumber[size]); ARRAY Vdrarray=NULL;Try{arraydescriptor Tableofnumber=Oracle.sql.ArrayDescriptor.createDescriptor ("Fnd_table_of_number", OracleConnection); Vdrarray=NewARRAY (Tableofnumber, OracleConnection, Vdridarray); String SQL= "BEGIN cux_xxxxxxx_pkg." UPDATE_BATCH_ID (: 1,:2); end; "; Statement=(oraclecallablestatement) oracleconnection.preparecall (SQL); Statement.setobject (1, BatchId); Statement.setarray (2, Vdrarray);                      Statement.execute (); }Catch(Exception ex) {string[][] stra2= {"123456wewee", Ex.getmessage ()},}; Logutil.of (Stra2, This). Print (PageContext);                            Ex.printstacktrace ();                           System.out.println (Ex.getmessage ()); } }                      

A parameter type is defined as an array in a stored procedure

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.