Re: [GENERAL] JDBC - Prepared statements and PostgreSql Time/Date operations

2007-05-18 Thread Jan Bilek
Got it! "Jan Bilek" <[EMAIL PROTECTED]> writes: I would like to use this query in java PreparedStatement, where age of a = row would be one of its parameters: PreparedStatement could look like this: select * from mytable where creation_time > (CURRENT_TIMESTAMP - ?) But nothing works with

Re: [GENERAL] JDBC - Prepared statements and PostgreSql Time/Date operations

2007-05-18 Thread Tom Lane
"Jan Bilek" <[EMAIL PROTECTED]> writes: > I would like to use this query in java PreparedStatement, where age of a = > row would be one of its parameters: > PreparedStatement could look like this: > select * from mytable where creation_time > (CURRENT_TIMESTAMP - ?) > But nothing works with Prepa

Re: [GENERAL] JDBC - Prepared statements and PostgreSql Time/Date operations

2007-05-18 Thread Martin Gainty
Hi Jan how about casting the parameter to date format e.g. select * from mytable where creation_time > (CURRENT_TIMESTAMP - $1::date) Anyone? M-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is add