Re: RE: datetime fix

Поиск
Список
Период
Сортировка
От Ken Kachnowich
Тема Re: RE: datetime fix
Дата
Msg-id 39F616B9.B228F44C@toad.net
обсуждение исходный текст
Ответ на datetime fix  (Ken Kachnowich <khkachn@toad.net>)
Список pgsql-interfaces
I do a PreparedStatement and setTimestamp() to do the select.
The Timestamp value is converted into a String in the JDBC code.

This may not be a JDBC problem. I can not select by a datetime field
in psql all the time. It seems if the milliseconds are below some
value it works and if above not. .62 worked for me but .71 did not.
I did a copy and paste of the datetime value to get it right:

select * from table_a;

| fld1
---------------------------
|2000-10-24 10:15:01.71-04|

select * from table_a where fld1 = '2000-10-24 10:15:01.71';

0 records found 

I had to make a change to the JDBC code to even get the .62 select to
work. The Timestamp toString() method gives a 3 digit millisecond
value and Postgres seems to not want the leading zero (ie: .62 viz
.062).

I will try these with query=1 in pg_options to get the query.


Ken

Cedar Cox wrote:
> 
> >  - select the datetime field from table A into a Timestamp variable
> >  - Use this Timestamp variable to select the record from table B
> >
> > I get no records found when I do this.
> 
> Interesting thought:  Is a timestamp numeric or string data?  How do you
> specify it in a query?  Do you quote it?
> 
> -Cedar


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Orlandi
Дата:
Сообщение: Re. IDXFORMAT - Cobol Format
Следующее
От: Dave Page
Дата:
Сообщение: RE: RE: JDBC now needs updates for large objects