Fujitsu J2X0-1634-01EN Computer Accessories User Manual


 
Specifying null values for all columns in data to be added
To set null values in all columns in data to be added, specify the keyword "DEFAULT VALUES" instead of specifying
an insert column list or an insert value list. The following is an example in which DEFAULT VALUES is specified:
Example 3:
In this example, a row of data is added to the ORDER table. All the columns for the data to be added
are specified with the default value defined for each column.
INSERT INTO STOCKS. ORDER DEFAULT VALUES
[Figure: Adding data in which default values are used for all columns]
3.1.3 Setting the current date and time in data to be added
To set the current date and time in the data to be added, specify the appropriate keyword in the insert value list of the
INSERT statement. To set the current date, specify CURRENT_DATE. To set the current time, specify
CURRENT_TIME. To set the current time-stamp, specify CURRENT_TIMESTAMP. An example of setting the current
time in the data to be added is given below.
The example uses the DAILY_ORDER table, which contains the orders of a single day. The table consists of four
columns: CUSTOMER, PRODNO, ORDERQTY, and PROCESS_TIME.
Example:
In this example, a row of data is added to the DAILY_ORDER table. The value "61" is specified for
CUSTOMER, the value of host variable PRODNO is specified for PRODNO, and the value of host
variable ORDERQTY is specified for ORDERQTY. The current time (16:30:17) is specified for
24