Link to home
Start Free TrialLog in
Avatar of wasabi3689
wasabi3689Flag for United States of America

asked on

cast fucntion to oracle

Can you help convert the following statement into oracle from TSQL?

CAST(DATEDIFF(second, '01-01-1970 00:00:00',getUtcDate()) AS BIGINT) * 1000 - 86400000
Avatar of Sean Stuber
Sean Stuber

(cast(systimestamp at time zone 'GMT' as date)  - date '1970-01-01' ) * 86400000
Avatar of wasabi3689

ASKER

I have the following statement, I need to convert into Oracle

INSERT INTO PRODUCTS (ID, NAME,VALUE) VALUES (15,'CTOXML', CAST(DATEDIFF(second, '01-01-1970 00:00:00',getUtcDate()) AS BIGINT) * 1000 - 86400000);
or if you're trying to subtract one day's worth of seconds

((systimestamp at time zone 'GMT' -1)  - date '1970-01-01' ) * 86400000
SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
wasabi1369,
Out of curiousity, what doe the TSQL statement you show produce assuming the current time for getutcdate()?
getutcdate()  

is equivalent to

cast (systimestamp at time zone 'GMT'  as date)
sdstuber, I agree. It's just that I wanted to see what the exact value of the statement would be?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, that's all I was looking for. I was just trying to get a grasp on what the intent was.