Oracle PL/SQL: To_Timestamp Function | Datetime Format Models

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Buffer 0 Email -- Filament.io 0 Flares ×

To_timestamp method in oracle is used with string (varchar2 or similar) or character sequences to convert it into timestamp type.The function requires the input string of timestamp and the format string as parameters.
Also Read TO_DATE ,TO_CHAR

TO_TIMESTAMP converts char of CHAR, VARCHAR2, NCHAR, or NVARCHAR2 datatype to a value of TIMESTAMP data type.

Example:
TO_TIMESTAMP(’12/12/200812:12:12:122222′,’DD/MM/YYYYHH12:MI:SS:FF’)

Optional parameters
1.The optional fmt specifies the format of char.
2.The optional ‘nlsparam’ argument has the same purpose in this function

See the example output below.

SQL>
SQL> select to_timestamp('12/12/2008 12:12:12:122222', 'DD/MM/YYYY HH12:MI:SS:FF') from dual;

TO_TIMESTAMP('12/12/200812:12:12:122222','DD/MM/YYYYHH12:MI:SS:FF')
12-DEC-08 12.12.12.122222000 PM<

SQL>

Read,

Technorati Tags:
, , , , , , , , ,

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Buffer 0 Email -- Filament.io 0 Flares ×

2 thoughts on “Oracle PL/SQL: To_Timestamp Function | Datetime Format Models

  1. Pingback: Oracle Trim Function | PL/SQL TRIM() Function. | SQL and PLSQL

  2. Pingback: Oracle timestamp format milliseconds| Oracle Date format | SQL and PLSQL

Leave a Reply

Your email address will not be published. Required fields are marked *

Paged comment generated by AJAX Comment Page