Re: Dates Help!!
Date: 1996/07/02
Message-ID: <4r9reb$a2s_at_inet-nntp-gw-1.us.oracle.com>#1/1
In article <4r9foo$da_at_goodnews.voicenet.com>, clarket_at_voicenet.com (Penn Thomas) writes:
|> I need help with dates and SQL. When I try to write a 'select'
|> statement which calls for the SysDate from 'DUAL' oracle tells me that DUAL
|> does not exist, I had believed that 'DUAL' is preset table which can not be
|> deleted in oracle.
DUAL is a table which is owned by SYS, and SELECT on it is granted to PUBLIC. SQL> desc dual
Name Null? Type ------------------------------- -------- ---- DUMMY VARCHAR2(1)
SQL> select * from dual;
D
-
X
I belive that it is created by catproc.sql, or one of the scripts which catproc calls.
|>
|> Also the SQL statement which I am trying to write calls, for the user to enter
|> a date within a program and then for oracle to search for all data between the
|> user's date, and theh 'SysDate', any help on how to write this is greatly
|> appreciated.
You can use the BETWEEN operator for this:
SELECT ...
FROM ...
WHERE <date-column> BETWEEN &input_date AND SYSDATE;
|>
|> thanks
You're welcome :)
|> clarke
|>
|>
-- ------------------------------------------------------------------------ Scott Urman Oracle Corporation surman_at_us.oracle.com ------------------------------------------------------------------------ Author of _Oracle PL/SQL Programming_ ISBN 0-07-882176-2 Published by Oracle Press - http://www.osborne.com/oracle/index.htm ------------------------------------------------------------------------ "The opinions expressed here are my own, and are not necessarily that of Oracle Corporation" ------------------------------------------------------------------------Received on Tue Jul 02 1996 - 00:00:00 CEST