简体   繁体   中英

How do we pass arrays from java to stored procedure in oracle

How to pass an array of Strings from java to stored procedure ?

What is the IN parameter in the stored procedure to receive an array ?

What I am trying to do is, for all the values(Ids) present in the array, I fetch the rowfrom table X and insert it into table X_Audit

I just spend the last few days working out a lot of JDBC related stuff, and one of my challenges was working out the answer to this exact question. I wrote up my solution on my blog: http://betteratoracle.com/posts/26-passing-arrays-between-java-and-oracle-procedures

You need to create some collection types on the database, and make the input parameters of the procedure have a type of the collections you created. See the article I posted above for full details and working code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM