pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew McNamara <andrewm@object-craft.com.au>
To: pgsql-interfaces@postgresql.org
Subject: PQexecParams and IN query?
Date: Fri, 11 May 2007 22:03:32 +1000
Message-ID: <20070511120332.6F61C5CC4B5@longblack.object-craft.com.au> (raw)

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/



view thread (3+ messages)  latest in thread

Message-ID: <20070511120332.6F61C5CC4B5@longblack.object-craft.com.au>
Permalink:  ../20070511120332.6F61C5CC4B5@longblack.object-craft.com.au/
Also on:    postgresql.org/message-id/20070511120332.6F61C5CC4B5@longblack.object-craft.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: andrewm@object-craft.com.au
  Subject: Re: PQexecParams and IN query?
  In-Reply-To: <20070511120332.6F61C5CC4B5@longblack.object-craft.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox