Re: BUG #3951: SELECT ... WHERE Param = ? does not work if Param is of type bytea - Mailing list pgsql-bugs

From Vincent D'Haene
Subject Re: BUG #3951: SELECT ... WHERE Param = ? does not work if Param is of type bytea
Date
Msg-id BAY124-W30C98FDFA2B98F8DBE8860FE230@phx.gbl
Whole thread Raw
In response to Re: BUG #3951: SELECT ... WHERE Param = ? does not work if Param is of type bytea  ("Gevik Babakhani" <pgdev@xs4all.nl>)
Responses Re: BUG #3951: SELECT ... WHERE Param = ? does not work if Param is of type bytea  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Gevik,

The link didn't help because that is not the same problem as I have:

My problem is that it seems that in postgresql you can't use a parameter bo=
und to BYTEA data in the WHERE clause of the SQL statement.

So in my case: "SELECT x FROM T WHERE BinData =3D ?" does not work (return =
code -1) if the parameter bound to the ? is of type BYTEA.


Vincent


> From: pgdev@xs4all.nl
> To: vincent_dhaene@hotmail.com; pgsql-bugs@postgresql.org
> Subject: RE: [BUGS] BUG #3951: SELECT ... WHERE Param =3D ? does not work=
 if Param is of type bytea
> Date: Sun, 10 Feb 2008 23:09:16 +0100
>=20
> perhaps this helps
>=20
> http://www.webservertalk.com/archive308-2007-3-1836413.html
>=20=20
>=20
> > -----Original Message-----
> > From: pgsql-bugs-owner@postgresql.org=20
> > [mailto:pgsql-bugs-owner@postgresql.org] On Behalf Of vha
> > Sent: Sunday, February 10, 2008 7:55 PM
> > To: pgsql-bugs@postgresql.org
> > Subject: [BUGS] BUG #3951: SELECT ... WHERE Param =3D ? does=20
> > not work if Param is of type bytea
> >=20
> >=20
> > The following bug has been logged online:
> >=20
> > Bug reference:      3951
> > Logged by:          vha
> > Email address:      vincent_dhaene@hotmail.com
> > PostgreSQL version: 8.3
> > Operating system:   Windows XP SP2
> > Description:        SELECT ... WHERE Param =3D ? does not work=20
> > if Param is of
> > type bytea
> > Details:=20
> >=20
> > I have a table with one of the columns of type BYTEA=20
> > containing GUIDs (16 bytes of data).
> >=20
> > The data of the column is specified using=20
> > SQLBindParameter(hstmt, nCol, SQL_PARAM_INPUT, SQL_C_BINARY,=20
> > SQL_BINARY, 16, 0, theGUID, 16, &ptr).
> >=20
> > This works fine to insert the data using "INSERT ... VALUES=20
> > ?", but retrieving the data using "SELECT ... WHERE Param =3D=20
> > ?" doesn't work: nothing is returned.
> >=20
> > Am I doing something wrong or is this a bug?
> >=20
> > BTW. This code works without any problem on MS SQL 2000, MS=20
> > SQL 2005, Oracle and MySQL.
> >=20
> >=20
> > vha
> >=20
> > ---------------------------(end of=20
> > broadcast)---------------------------
> > TIP 1: if posting/reading through Usenet, please send an appropriate
> >        subscribe-nomail command to majordomo@postgresql.org=20
> > so that your
> >        message can get through to the mailing list cleanly
> >=20
>=20

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/=

pgsql-bugs by date:

Previous
From: Ярослав Якубовский
Date:
Subject: Bug Attached Table Ms Access97 with Boolean
Next
From: Laurent Barbier
Date:
Subject: Initdb error without much more details PostgreSQL 7.4.19