-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Oracle SYSDATE
PostPosted: Tue Jul 26, 2005 2:41 pm 
Hi. I'm having trouble using SQL statements against an Oracle 9i database that has SYSDATE in the where clause (returns the current date/time - I believe it is equivalent to getdate() in SQL Server). With logging turned on, I see that the SQL statement parser always translates SYSDATE as a column of the table that is being queried, but actually it is a function that is called as a pseudo-column from the DUAL table (as in SELECT SYSDATE FROM DUAL).

So if I say SELECT MYCOLUMN FROM MYTABLE WHERE MYDATE > SYSDATE, the translation is something similar to SELECT MYTABLE0_.MYCOLUMN FROM MYTABLE MYTABLE0_ WHERE MYTABLE0_.MYDATE > MYTABLE0_.SYSDATE. The problem of course is that SYSDATE is not a column of MYTABLE, so Oracle returns an error that the column is unspecified.

Is there another way to search record via dates when using Oracle?

Cheers,
Curtis Olson


Top
  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.