INTERVAL DAY(3) TO SECOND (4) : INTERVAL « Date Timezone « Oracle PL / SQL

Oracle PL / SQL
1. Aggregate Functions
2. Analytical Functions
3. Char Functions
4. Constraints
5. Conversion Functions
6. Cursor
7. Data Type
8. Date Timezone
9. Hierarchical Query
10. Index
11. Insert Delete Update
12. Large Objects
13. Numeric Math Functions
14. Object Oriented Database
15. PL SQL
16. Regular Expressions
17. Report Column Page
18. Result Set
19. Select Query
20. Sequence
21. SQL Plus
22. Stored Procedure Function
23. Subquery
24. System Packages
25. System Tables Views
26. Table
27. Table Joins
28. Trigger
29. User Previliege
30. View
31. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Oracle PL / SQL » Date Timezone » INTERVAL 
INTERVAL DAY(3) TO SECOND (4)



SQL> CREATE TABLE promotions (
  2    promotion_id INTEGER,
  3    name VARCHAR2(30),
  4    duration INTERVAL DAY(3TO SECOND (4)
  5  );

Table created.

SQL>
SQL>
SQL> INSERT INTO promotions (promotion_id, name, duration)
  2  VALUES (1'10% off Z Files', INTERVAL '3' DAY);

row created.

SQL> INSERT INTO promotions (promotion_id, name, duration)
  2  VALUES (2'20% off Pop 3', INTERVAL '2' HOUR);

row created.

SQL> INSERT INTO promotions (promotion_id, name, duration)
  2  VALUES (3'30% off Modern Science', INTERVAL '25' MINUTE);

row created.

SQL> INSERT INTO promotions (promotion_id, name, duration)
  2  VALUES (4'20% off Tank War', INTERVAL '45' SECOND);

row created.

SQL> INSERT INTO promotions (promotion_id, name, duration)
  2  VALUES (5'10% off Chemistry', INTERVAL '3 2:25' DAY TO MINUTE);

row created.

SQL> INSERT INTO promotions (promotion_id, name, duration)
  2  VALUES (6'20% off Creative Yell',
  3   INTERVAL '3 2:25:45' DAY TO SECOND);

row created.

SQL> INSERT INTO promotions (promotion_id, name, duration)
  2  VALUES (7'15% off My Front Line',
  3   INTERVAL '123 2:25:45.12' DAY(3TO SECOND(2));

row created.

SQL>
SQL> SELECT *
  2  FROM promotions;

PROMOTION_ID NAME                           DURATION
------------ ------------------------------ ---------------------------------------------------------------------------
           1 10% off Z Files                +003 00:00:00.0000
           2 20% off Pop 3                  +000 02:00:00.0000
           3 30% off Modern Science         +000 00:25:00.0000
           4 20% off Tank War               +000 00:00:45.0000
           5 10% off Chemistry              +003 02:25:00.0000
           6 20% off Creative Yell          +003 02:25:45.0000
           7 15% off My Front Line          +123 02:25:45.1200

rows selected.

SQL>
SQL> drop table promotions;

Table dropped.

SQL>
SQL>
           
       
Related examples in the same category
1. Using the INTERVAL YEAR TO MONTH Type
2. INTERVAL YEAR(3) TO MONTH
3. INTERVAL DAY TO SECOND type to store time intervals measured in days and seconds
4. INTERVAL DAY TO SECOND
5. Use date time Interval type: interval day(1) to second(2)
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.