File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Oracle CHAR bind parameter 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 "Oracle CHAR bind parameter" Watch "Oracle CHAR bind parameter" New topic

Oracle CHAR bind parameter

Bikram Rathod

Joined: Jul 26, 2005
Posts: 1
We are using Prepared Statement to access oracle 9i database from a Java application. For a CHAR datatype in Oracle we are using the String datatype as binding parameter. It works fine when the search criteria is Partial Search(using 'LIKE' clause). It fails when the search criteria is supposed to be equal match (=). By fail I mean 0 Records are returned . But when the query is run standalone on SQLPLUS it returns records. Has anybody encountered any such situation.
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1082

could you paste your code and query to put better clarity on your problem


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

try TRIM() on both sides of the '=' comparison.
I agree. Here's the link:
subject: Oracle CHAR bind parameter
It's not a secret anymore!