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.
Ever since I found this suit I've felt strange new needs. And a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|