Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Date Types
Markus,
try this
select to_char(sysdate,'DD/MM/YYYY HH24: MI : SS') from dual;
This will give you date from year to second.
create table tommy (id varchar2(20) default to_char(sysdate,'DD/MM/YYYY'),
name varchar2(10))SQL> / Table created.
SQL> insert into tommy (name) values('Tom');
1 row created.
SQL> select * from Tommy;
ID NAME -------------------- ---------- 14/03/2000 Tom
Markus Janscha <markus_at_janscha.co.uk> wrote in message
news:8ajk3m$8tl$1_at_gxsn.com...
> Hey All,
>
> I would like to set the input date as the primary key ae: each day only
> allows one entry .
> What data type do I use? I read in the Oracle manual that the date type
also
> stores hours.
> I need to store the day (dd-mm-yyyy) only and make this unique. I should
> also still be able to do date arithmetic.
>
> Thanks
> Markus
>
>
>
>
Received on Tue Mar 14 2000 - 00:00:00 CST
![]() |
![]() |