Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax for replacement of CAST/FROM_TZ

Status
Not open for further replies.

blom0344

Technical User
Mar 20, 2002
3,441
0
0
NL
I just found out that Oracle8 does not support the CAST expression. The following works quite nicely in 9i:

Code:
CASE WHEN DS_PENDING_JOB.JOB_STATUS In (2, 3, 4, 6, 1006) THEN to_date(null) ELSE (from_tz(CAST(to_date('15/12/1970','DD/MM/YYYY')+(DS_PENDING_JOB.START_DATETIME/(24*60*60)) as TIMESTAMP), 'GMT') AT LOCAL) END

Is there a guru who can tell what the equivalent would be in Oracle 8?

Ties Blom

 
Use decode:

Code:
SELECT DECODE(DS_PENDING_JOB.JOB_STATUS , 2, TO_DATE(NULL), 3, TO_DATE(NULL), 4, TO_DATE(NULL), 6, TO_DATE(NULL), 1006, TO_DATE(NULL),
(from_tz(CAST(to_date('15/12/1970','DD/MM/YYYY')+(DS_PENDING_JOB.START_DATETIME/(24*60*60)) as TIMESTAMP), 'GMT') AT LOCAL)) X
FROM DUAL
 
Uh,

The problem is with the CAST (not CASE)

Version 8 does not allow me to cast a date as a TIMESTAMP, whereas this is perfectly possible in 9i..

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top