-
simple table query
i have created a table called std_detail:
create table std_detail (ENAME VARCHAR2(30), ROLL_NO VARCHAR2(5), time date);
ENAME ROLL_NO TIME
---------------------------------------------------------------------
i want that whenever i insert into the table ,the time field should get updated according to the system date like( select sysdate from dual).
for e.g.
insert into std_detail (ename,roll_no) values( 'jeevan',09987)
then the table should look like:
ENAME ROLL_NO TIME
jeevan 09987 6/25/2008 3:17:36 PM
-----------------------------------------------------------------------
can anyone help me in this
-
You either need to change your insert to
insert into std_detail (ename, roll_no, time) values ('jeevan',09987, sysdate)
or alter table st_detail modify time default sysdate
-
insert into std_detail (ename,roll_no,time) values( 'jeevan',09987,sysdate);
-
thanks a lot but i got this solution:
create table std_detail (ENAME VARCHAR2(30), ROLL_NO VARCHAR2(5), time date default(sysdate));
-
Gud
-
Which was my second suggestion above
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|