[OT] Duration between two timestamps

Started by phil campaigneabout 21 years ago2 messagesgeneral
Jump to latest
#1phil campaigne
pcampaigne@charter.net

Hi All,
In my java application I need to subtract two java.sql.timestamps. and I
want to store the result as sql type "interval".
But my insert statement is failing.

Does anyone know what java type I need to use in the insert statement?
(it must accept null values)
thanks in advance,
Phil

#2Chris Smith
chris@interspire.com
In reply to: phil campaigne (#1)
Re: [OT] Duration between two timestamps

Hi Phil,

Have you tried copying the insert statement straight into postgres?
print it out (or log it or whatever) and try that first.. that'll narrow
things down a little.

phil campaigne wrote:

Hi All,
In my java application I need to subtract two java.sql.timestamps. and I
want to store the result as sql type "interval".
But my insert statement is failing.

Does anyone know what java type I need to use in the insert statement?
(it must accept null values)
thanks in advance,
Phil

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
Regards,

Chris Smith

Suite 30, 45-51 Huntley St, Alexandria, NSW 2015 Australia

Ph: +61 2 9517 2505
Fx: +61 2 9517 1915

email: info@interspire.com
web: www.interspire.com