This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes For Oracle 8i, PreparedStatement Query fails for Key. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "For Oracle 8i, PreparedStatement Query fails for Key." Watch "For Oracle 8i, PreparedStatement Query fails for Key." New topic
Author

For Oracle 8i, PreparedStatement Query fails for Key.

CGI Tokyo
Greenhorn

Joined: Nov 13, 2001
Posts: 3
I m using Oracle 8i with JDBC Thin Driver. I use PreparedStatement to do a Table Update, there is a key Criteria for the Update. Though the Record is present in DB (for that key), the Update gives shows 0 Records updated and Table is not updated. If I pad the Key with spaces for the column length (eg if the key column is 20 characters long, and key is msgID, I pad it with 14 spaces), the Query works!!! If there any solution to this problem without Padding?
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"CGI Tokyo",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name.
This account will be closed, please re-register and select a new name which meets the requirements.
Thanks.
Dave
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

is the column datatype CHAR or VARCHAR? regarding the query,does it work when left padded or right padded with blanks?
...you'll have to change your name first though.
Jamie
 
 
subject: For Oracle 8i, PreparedStatement Query fails for Key.
 
Similar Threads
Get Updated Record
Accessing oracle Nested tables in java
In PreparedStatement table name can vary
auto insert in jdbc
find second largest value in a column