Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Query, SELECT STATEMENT, Wont Work With Dates

843836Jun 6 2005 — edited Jun 7 2005
Hi guys and gals,

I have the following code:
strSQL="SELECT * FROM _EVENTS WHERE DATE_START LIKE '%JUN%'";
				 
Statement stmt = conn.createStatement ();            
rsPaging = stmt.executeQuery(strSQL);
It brings back 'No Results', however I know there is one record in the database that matches this criteria.

What I have tested thus far:
1) I have copied and pasted this code into SQL Plus WorkSheet and it executes like it supposed to and returns one record.

2) I have changed the field from DATE_START to TITLE and the values from %JUN% to %NET% and it brings back the record I am looking for. So the statement, connection, etc work

3) and just for kicks I also tried the following:
strSQL="SELECT * FROM _EVENTS WHERE TO_CHAR(DATE_START) LIKE '%JUN%'";
				 
Statement stmt = conn.createStatement ();            
rsPaging = stmt.executeQuery(strSQL);
and also a no-go.

So... in conclusion the statement seems to work fine, however, it seems to have problems with DATES? I am using Oracle 10g and the driver info is:

Jdbc Driver is : Oracle JDBC driver
Jdbc Driver Version is : 9.0.1.5.0


Thanks in advance!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 5 2005
Added on Jun 6 2005
8 comments
649 views