Converting Timestamp to timestamp with time zone

Database

Converting Timestamp to timestamp with time zone

I have a requirement where I have 2 columns
column 1 holds a timestamp value
and column 2 holds time zone for ex +03:00
I have to combine both of these and insert into a column of type
timestamp with time zone.

I was trying the following query but it was not working (sql assistant)

SEL CAST(CURRENT_TIMESTAMP AS TIMESTAMP WITH TIME ZONE FORMAT 'YYYY-MM-DDBHH:MI:SSDS(F)Z')

result is
5/15/2010 21:42:06.097000
where I was expecting it like
2010-05-15 21:42:06.097+00:00

any ideas to acheive this would be appreciated.

P.S: If its because of the settings please let me know which settings are to be changed.

Thanks,
chaitanya
1 REPLY

Re: Converting Timestamp to timestamp with time zone

The FORMAT specifier is only meaningful if the value is either (a) exported in report form, as to BTEQ, or (b) with CAST when converting to or from a character type.

SQL Assistant does not support report mode.

Try this:

select cast(current_timestamp as char(32));