• Sharebar

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:
, , , , , , , , ,

 
SEO Powered by Platinum SEO from Techblissonline