From: | Ken Kachnowich <khkachn(at)toad(dot)net> |
---|---|
To: | Cedar Cox <cedarc(at)visionforisrael(dot)com>, Postgres interfaces <pgsql-interfaces(at)postgresql(dot)org> |
Subject: | Re: RE: datetime fix |
Date: | 2000-10-24 23:09:45 |
Message-ID: | 39F616B9.B228F44C@toad.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Dave Page | 2000-10-25 08:28:33 | RE: RE: JDBC now needs updates for large objects |
Previous Message | Orlandi | 2000-10-24 22:32:48 | Re. IDXFORMAT - Cobol Format |