On Wed, 2007-03-28 at 11:11 +0200, Jonas Sandman wrote:
> Yes, it seems so.
> 
> Still, can this be done without knowing how many extensions there are on
> beforehand?
> what happens if I make a
> 
> SELECT * FROM Files WHERE extension IN (:ext1, :ext2, :ext3, :ext4) and only
> bind :ext1 but not the others? An error?

After a statement is prepared, SQL NULL is implicitly bound to all
variables. So if you bind to :ext1 and :ext2 only, it's like doing:

  SELECT * FROM files where extension IN ('avi', 'mpg', NULL, NULL);

Which would probably work for you. Note that sqlite3_reset() does not
reset the values of SQL variables.

> Is it slow building a statement with sqlite3_prepare16_v2 before executing
> it?

Probably not. If you're not doing it more than a few times per second
I wouldn't worry about it.

> Best regards,
> Jonas
> 
> On 3/28/07, Alan Barkway <[EMAIL PROTECTED]> wrote:
> >
> > On Wed, 28 Mar 2007 08:38:55 +0100, Jonas Sandman
> > <[EMAIL PROTECTED]> wrote:
> >
> > [...]
> > >
> > > SELECT * FROM Files WHERE extension IN (:extension)
> >
> > Just a guess here but might it be the case that you need to do this?
> >
> > SELECT * FROM Files WHERE extension IN (:ext1, :ext2, :ext3)
> >
> >
> > -----------------------------------------------------------------------------
> > To unsubscribe, send email to [EMAIL PROTECTED]
> >
> > -----------------------------------------------------------------------------
> >
> >


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to