Use the Timestamp data type in a table and insert data : Timestamp « Data Type « Oracle PL / SQL

Oracle PL / SQL
1. Aggregate Functions
2. Analytical Functions
3. Char Functions
4. Constraints
5. Cursor
6. Data Type
7. Date Timezone
8. Hierarchical Query
9. Index
10. Insert Delete Update
11. Numeric Math Functions
12. Object Oriented Database
13. PL SQL
14. Regular Expressions
15. Report Column Page
16. Result Set
17. Select Query
18. Sequence
19. SQLPlus
20. Store Procedure Function
21. Subquery
22. System Tables
23. Table
24. Table Joins
25. Trigger
26. User Previliege
27. View
28. XML
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Oracle PL / SQL » Data Type » Timestamp 
Use the Timestamp data type in a table and insert data


SQL>  create table conference_calls (
  2        title   varchar2(100),
  3        phone   varchar2(20),
  4        place   varchar2(100),
  5        starts  timestamp with time zone)
  6    /

Table created.

SQL>
SQL>  insert into conference_calls (title, phone, place, starts)
  2      values ('Sales Strategy', '212.123.4567', 'Washington',
  3              TIMESTAMP '2001-12-01 15:00:00.000000 EST')
  4      /

row created.

SQL>
SQL> insert into conference_calls (title, phone, place, starts)
  2   values ('Product Features', '650.123.4567', 'San Francisco',
  3              TIMESTAMP '2001-12-01 17:00:00.000000 PST')
  4    /

row created.

SQL>
SQL> insert into conference_calls (title, phone, place, starts)
  2      values ('Football Highlights', '44 1234 5678', 'London',
  3              TIMESTAMP '2001-12-01 20:00:00.000000 GMT')
  4    /

row created.

SQL>
SQL>
SQL> select from conference_calls;

TITLE                                                                                                PHONE
---------------------------------------------------------------------------------------------------- --------------------
PLACE                                                                                                STARTS
---------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------
Sales Strategy                                                                                       212.123.4567
Washington                                                                                           01-DEC-01 03.00.00.000000 PM EST

Product Features                                                                                     650.123.4567
San Francisco                                                                                        01-DEC-01 05.00.00.000000 PM PST

Football Highlights                                                                                  44 1234 5678
London                                                                                               01-DEC-01 08.00.00.000000 PM GMT


SQL>
SQL> select title, phone
  2        from conference_calls
  3        where starts = TIMESTAMP '2001-12-01 15:00:00.000000 -5:00'
  4    /

TITLE                                                                                                PHONE
---------------------------------------------------------------------------------------------------- --------------------
Sales Strategy                                                                                       212.123.4567
Football Highlights                                                                                  44 1234 5678

SQL>
SQL> drop table conference_calls;

Table dropped.

SQL>
SQL>

           
       
Related examples in the same category
1. Compare data and timestamp
2. INSERT statement adds a row with the TIMESTAMP keyword to supply a datetime literals
3. Use the TIMESTAMP type to define a column in a table
4. TIMESTAMP WITH TIME ZONE type extends TIMESTAMP to allow you to store a time zone
5. TIMESTAMP(4) WITH TIME ZONE
ww___w_.__ja_v__a___2s_.c___o___m_ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.