This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Insert statement not inserting correct value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Insert statement not inserting correct value" Watch "Insert statement not inserting correct value" New topic

Insert statement not inserting correct value

Seema Hanji
Ranch Hand

Joined: Jan 29, 2001
Posts: 37
Hi All,
I am trying to insert a record into Oracle-8 database using JDBC. For a particular column somehow the data is inserted partially. This colum is of type VARCHAR2(256) . I could successfully insert comma seperated values say 'CA,GA,CO' . But when I try to insert the value like 'Exclude CA,GA,CO' it inserts only 'Exclude '. When I run this insert statement using sql*plus, it inserts fine . but inserts partially as said above when I try to insert through JDBC using
Just before executing this statement in my java code, I am printing out the insert statement and it looks fine.
Any idea why???
Thanks in advance,
[ June 26, 2002: Message edited by: Seema Hanji ]
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Can you post the insert statement that is printed out? Also, are there any ' in it? Those can give you a problem if they are not properly escaped.
Just to clarify, you're putting comma separated data all into the same column not into multiple columns right?

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Insert statement not inserting correct value
jQuery in Action, 3rd edition