|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
Hello All,
A quick one about dates in Oracle. How do you get an Oracle DBMS to produce a date object when a tuple is created, and place this date in the tuple? Thanks Chris |
|
#2
|
|||
|
|||
|
The date function SYSDATE returns the current system date and time, You can use it in any DML or DDL operation, some examples are given below:
CREATE TABLE myemp (EMPNO number(5), ENAME varchar2(25), HIREDATE date DEFAULT SYSDATE NOT NULL, SAL number(5)) / INSERT INTO myemp (empno,ename,sal) VALUES (10908,'Smith',2300) / System date will be automatically inserted into the above tuple because hiredate has default value SYSDATE. DECLARE p_hiredate date:=SYSDATE; //assigning System date to a variable. ........ ........ ........ BEGIN DBMS_OUTPUT.PUT_LINE(p_hiredate); ........ ........ END: / Regards, |
|
#3
|
|||
|
|||
|
Cheers
Thanks for that!
Chris |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Simple question - Dates in Oracle |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|