Re: Dates Help!!

From: Sanjay D. S. <sanjay_at_fsg.prusec.com>
Date: 1996/07/02
Message-ID: <31D98E9E.41C6_at_fsg.prusec.com>#1/1


Penn Thomas wrote:
>
> 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.
>
> 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.
>
>

I suppose your ORACLE account may not have enough privileges to access dual table.
Try the following:
SQL> connect user_id/password
SQL> select * from sys.dual;
If you get rows selected then probably the public synonym is missing: SQL> connect sys/password
SQL> create public synonym dual for sys.dual; If no rows are selected and you get message ORA-00942: table or view does not exists:
SQL> connect sys/password
SQL> grant select on dual to public;

If grant statement also fails because of ORA-00942. Table dual does not exists under sys acocunt, Create one in sys account with one row:

create table dual(dummy varchar2(1));
insert into dual values('X');
and grant neccessary privileges to all users.

And the 2nd Query would be:
select * from tab where tab_date between  &date_entered and sysdate;

HTH Sanjay D. S.
Oracle Consultant
Prudential Securities, Inc. Received on Tue Jul 02 1996 - 00:00:00 CEST

Original text of this message