Skip site navigation (1) Skip section navigation (2)

Problem with fixed length fields.

From: Dave Smith <dave(dot)smith(at)candata(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Problem with fixed length fields.
Date: 2004-10-23 11:54:10
Message-ID: 1098532450.2684.3.camel@davehome (view raw or flat)
Thread:
Lists: pgsql-jdbc
Platform:
Postgres 7.4.5, lastest JDBC driver from CVS.

Table:
create table t(a char(2),b char(2));
insert into t values ('  ','  ');

Jdbc: 

This query finds nothing
PreparedStatement st = db.prepareStatement("select * from t where a=?
and b=?");
st.setString(1,"  ");
st.setString(2,"  ");
ResultSet rs = st.executeQuery();

This query works
rs = db.prepareStatement("select * from t where a='  ' and b=' 
'").executeQuery();

Why?






Responses

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2004-10-23 17:50:42
Subject: Re: Problem with fixed length fields.
Previous:From: Kris JurkaDate: 2004-10-22 22:40:49
Subject: Re: patch: bring org/postgresql/test/README up to date

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group