INTERVAL DAY TO SECOND type to store time intervals measured in days and seconds : INTERVAL « Date Timezone « Oracle PL / SQL






INTERVAL DAY TO SECOND type to store time intervals measured in days and seconds


SQL> -- INTERVAL DAY TO SECOND type to store time intervals measured in days and seconds.
SQL>
SQL> CREATE TABLE promotions (
  2    promotion_id INTEGER CONSTRAINT promotions_pk PRIMARY KEY,
  3    name VARCHAR2(30) NOT NULL,
  4    duration INTERVAL DAY(3) TO SECOND (4)
  5  );

Table created.

SQL>
SQL>
SQL> desc promotions;
 Name                                                                                                  Null?    Type
 ----------------------------------------------------------------------------------------------------- -------- -----------------------
 PROMOTION_ID                                                                                          NOT NULL NUMBER(38)
 NAME                                                                                                  NOT NULL VARCHAR2(30)
 DURATION                                                                                               INTERVAL DAY(3) TO SECOND(4)

SQL>
SQL> drop table promotions;

Table dropped.

           
       








Related examples in the same category

1.Using the INTERVAL YEAR TO MONTH Type
2.INTERVAL YEAR(3) TO MONTH
3.INTERVAL DAY(3) TO SECOND (4)
4.INTERVAL DAY TO SECOND
5.Use date time Interval type: interval day(1) to second(2)