Well, to be honest that's what I'm doing right now - for development
purposes.  But when I turn this over the number of values needs to be
dynamic so I really would like to pass a single value to an IN statement or
something similar.

Dunc.

-----Original Message-----
From: Brian Collins [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 09, 2001 2:54 PM
To: Duncan Hudson
Subject: RE: Can't pass IN value to


Just create a mutiple or query like so.  Make sure to encapsulate it with
().

($prov_types = '1' or $prov_types = '2' or $prov_types =  '4')

-----Original Message-----
From: Duncan Hudson [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 09, 2001 1:59 PM
To: msql-mysql-modules@lists.; [EMAIL PROTECTED]
Subject: Can't pass IN value to


Hi, I'm having problem's trying to dynamically create an IN statement with
for MySQL.  I'm using Activestate Perl 5.6, MySQL server 3.23.32, MySQL
client 3.23.22, and DBI 1.14 all under Windows 2000 Professional.  I want my
SQL statement to look like this:

$sth_provider  = $dbh->prepare("SELECT provider
                                  FROM provider
                                 WHERE provider.status = ?
                                   AND provider_type in (?)");
$sth_provider->execute('OK', $prov_types) || die "Can't select PROVIDER
row(s): $DBI::errstr";

The SQL works as long as the $prov_types variable contains only one numeric
value.  However, when it contains two or more values (eg. $prov_types = '1,
2, 4') I only get the records associated with the first value (1) in the
list.  I've tried specifying the IN values just about every way I can, but I
still get the same results.  Anyone have any thoughts / ideas?  Thanks in
advance,


C. Duncan Hudson
Dynax Solutions, Inc.

Tel   216.292.8203
FAX   216.292.8273
EMail [EMAIL PROTECTED]


Reply via email to