Neoview SQL Reference Manual (R2.5)

CONVERTTIMESTAMP Function
The CONVERTTIMESTAMP function converts a Julian timestamp to a value with data type
TIMESTAMP.
CONVERTTIMESTAMP is a Neoview SQL extension.
CONVERTTIMESTAMP (julian-timestamp)
julian-timestamp
is an expression that evaluates to a Julian timestamp, which is a LARGEINT value.
Considerations for CONVERTTIMESTAMP
The julian-timestamp value must be in the range from 148731163200000000 to
274927348799999999.
Relationship to the JULIANTIMESTAMP Function
The operand of CONVERTTIMESTAMP is a Julian timestamp, and the function result is a value
of data type TIMESTAMP. The operand of the CONVERTTIMESTAMP function is a value of
data type TIMESTAMP, and the function result is a Julian timestamp. That is, the two functions
have an inverse relationship to one another.
Use of CONVERTTIMESTAMP
You can use the inverse relationship between the JULIANTIMESTAMP and
CONVERTTIMESTAMP functions to insert Julian timestamp columns into your database and
display these column values in a TIMESTAMP format.
Examples of CONVERTTIMESTAMP
Suppose that the EMPLOYEE table includes a column, named HIRE_DATE, which contains
the hire date of each employee as a Julian timestamp. Convert the Julian timestamp into a
TIMESTAMP value:
SELECT CONVERTTIMESTAMP (hire_date)
FROM persnl.employee;
This example illustrates the inverse relationship between JULIANTIMESTAMP and
CONVERTTIMESTAMP.
SELECT CONVERTTIMESTAMP (JULIANTIMESTAMP (ship_timestamp))
FROM persnl.project;
If, for example, the value of SHIP_TIMESTAMP is 2008-04-03 21:05:36.143000, the result of
CONVERTTIMESTAMP(JULIANTIMESTAMP(ship_timestamp)) is the same value,
2008-04-03 21:05:36.143000.
368 SQL Functions and Expressions