Call SYSDATE in insert statement : Date « SQL Data Types « Oracle PL/SQL Tutorial






SQL>
SQL> create table myTable (
  2  event_name    varchar2( 100 ),
  3  event_date    date );

Table created.

SQL>
SQL>
SQL>
SQL> insert into myTable ( event_name, event_date )
  2  values ( 'Created DATE Sample code', SYSDATE );

1 row created.

SQL>
SQL>
SQL> select * from myTable;


EVENT_NAME                        EVENT_DAT
----------------------------------
Created DATE Sample code          03-JUN-07

SQL> drop table myTable;

Table dropped.








10.6.Date
10.6.1.Process and store a specific date and time.
10.6.2.Use the DATE keyword to supply a date literal to the database.
10.6.3.Cast string to date in where clause
10.6.4.Setting the Default Date Format
10.6.5.Storing and Retrieving Dates
10.6.6.Default time field
10.6.7.Combining TO_CHAR() and TO_DATE() Calls
10.6.8.Converting a DATE to Another Language
10.6.9.Compare date type value in where clause
10.6.10.Query for NULL Date type data
10.6.11.TRUNC(Start_date)
10.6.12.TO_CHAR(start_date, 'MM-DD-YYYY HH24:MI')
10.6.13.Call SYSDATE in insert statement
10.6.14.Check Date format before inserting
10.6.15.Add condition constraint to date type column
10.6.16.Greater than a date
10.6.17.BETWEEN for date type value
10.6.18.Date calculation