Re: SYSDATE for a default value
Date: Tue, 29 Jun 1999 09:58:34 +0800
Message-ID: <7l98st$ce4_at_eugwy1.bp.com>
If you are creating a new table, you can use: create table a (a1 varchar2(2), a2 date default sysdate); if you want to modify an existing table, you can do: alter table a modify a2 default sysdate;
Good Luck
David Rabsch wrote in message <37778763.509CF5FC_at_palliser.ca>...
>Hi, I'm a newbie, so please excuse this if it's an elementary
>question.....
>
>I want to have the default value in a table be the current date and
>time, and found the function SYSDATE. Seems like the right thing to
>do. My question is, how do I put the result of SYSDATE into the field?
>What's the correct syntax? Do I use a trigger on the table, and if so,
>when? I've already got one trigger to automatically increase a value in
>an ID field by one every time a new field is inserted and it works
>great, but I tried to do the same thing with the SYSDATE function with
>no luck. I'm coming over from Access, so my sql (and esp. PL/SQL) is
>horrible. Thx for the help.
>
Received on Tue Jun 29 1999 - 03:58:34 CEST