PQexecParams and IN query?

From: Andrew McNamara <andrewm(at)object-craft(dot)com(dot)au>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: PQexecParams and IN query?
Date: 2007-05-11 12:03:32
Message-ID: 20070511120332.6F61C5CC4B5@longblack.object-craft.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

I'm trying to use PQexecParams to do an "IN" query, where the set of
values is supplied as a single parameter - essentially:

SELECT * FROM sometable WHERE colvalue IN $1

With $1 as a set or array of some sort. Unfortunately, the above doesn't
pass parsing. Is there any way to do an IN query via PQexecParams that
doesn't involve enumerating the set of values as individual parameters?

Previously, we were using PQexec(), and the adapter layer was conveniently
expanding the set into the command.

--
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Gregory Stark 2007-05-11 12:31:27 Re: PQexecParams and IN query?
Previous Message Michael Meskes 2007-05-11 11:16:47 PQprepare question