Martin Vajsar wrote:Are you trying to insert several records at once? If so, it is not possible this way. You need to execute the statement repeatedly, once for every course.
If you're really trying to insert an array into a column, what is the database type of the column? The most common types certainly do not support inserting arrays into them.
Bear Bibeault wrote:Moved to the JDBC forum.
NitishK Kumar wrote:
Why not, after all I am using prepared statement. And, as I have already mention, I tried the same with an standalone application and its working fine. My database array type is varchar2().
Martin Vajsar wrote:
Why what? What are you trying to achieve? Insert one record with array stored in a column, or insert several records? The answer depends on that.
Inserting several records: by definition INSERT ... VALUES statement creates just one record.
Inserting array: VARCHAR2 datatype cannot hold an array. In Oracle, you can create a VARRAY type and use it in a table (though I have no experience with this), but then it would not be a simple VARCHAR2 column.
Can you post the code that worked (the standalone application you mentioned), including table creation statement? What did the value looked like when you selected it back from the table using some tool (TOAD, SQL Developer)?
NitishK Kumar wrote:I solved my problem and now its working.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton