aspose file tools*
The moose likes JDBC 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
Bookmark "Oracle CHAR bind parameter" Watch "Oracle CHAR bind parameter" New topic
Author

Oracle CHAR bind parameter

Bikram Rathod
Greenhorn

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: 1081

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

Shailesh


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.
 
 
subject: Oracle CHAR bind parameter