Re: suppress quoting in prepared sql

2016-04-05 Thread Darren Duncan
[mailto:p...@snake.net] Sent: Tuesday, April 05, 2016 11:37 AM To: Vaughan, Mark Cc: Bruce Ferrell; dbi-users@perl.org Subject: Re: suppress quoting in prepared sql On Apr 5, 2016, at 12:29 PM, Vaughan, Mark <mark.vaug...@neustar.biz> wrote: This works if the number of elements remains st

Re: suppress quoting in prepared sql

2016-04-05 Thread Darren Duncan
[mailto:p...@snake.net] Sent: Tuesday, April 05, 2016 11:37 AM To: Vaughan, Mark Cc: Bruce Ferrell; dbi-users@perl.org Subject: Re: suppress quoting in prepared sql On Apr 5, 2016, at 12:29 PM, Vaughan, Mark <mark.vaug...@neustar.biz> wrote: This works if the number of elements remains st

Re: suppress quoting in prepared sql

2016-04-05 Thread Tim Bunce
> From: Paul DuBois [mailto:p...@snake.net] > Sent: Tuesday, April 05, 2016 11:25 AM > To: Bruce Ferrell <bferr...@baywinds.org> > Cc: dbi-users@perl.org > Subject: Re: suppress quoting in prepared sql > > > > On Apr 5, 2016, at 11:55 AM, Bruce Ferrell <bferr...@bay

RE: suppress quoting in prepared sql

2016-04-05 Thread Howard, Chris
-Original Message- > From: Paul DuBois [mailto:p...@snake.net] > Sent: Tuesday, April 05, 2016 11:25 AM > To: Bruce Ferrell <bferr...@baywinds.org> > Cc: dbi-users@perl.org > Subject: Re: suppress quoting in prepared sql > > >> On Apr 5, 2016, at 11:55 AM, Bruce Ferr

Re: suppress quoting in prepared sql

2016-04-05 Thread Paul DuBois
> From: Paul DuBois [mailto:p...@snake.net] > Sent: Tuesday, April 05, 2016 11:25 AM > To: Bruce Ferrell <bferr...@baywinds.org> > Cc: dbi-users@perl.org > Subject: Re: suppress quoting in prepared sql > > >> On Apr 5, 2016, at 11:55 AM, Bruce Ferrell <bf

RE: suppress quoting in prepared sql

2016-04-05 Thread Vaughan, Mark
: +1.303.802.1350  /  mark.vaug...@neustar.biz -Original Message- From: Paul DuBois [mailto:p...@snake.net] Sent: Tuesday, April 05, 2016 11:25 AM To: Bruce Ferrell <bferr...@baywinds.org> Cc: dbi-users@perl.org Subject: Re: suppress quoting in prepared sql > On Apr 5, 2016, at

Re: suppress quoting in prepared sql

2016-04-05 Thread Paul DuBois
> On Apr 5, 2016, at 11:55 AM, Bruce Ferrell wrote: > > Ick! > > ok, I have to dynamically build the IN clause of the prepare as a static sql > statement Yep. This is how I do it for a given array of values: # Create a string of placeholder characters, with one ?

Re: suppress quoting in prepared sql

2016-04-05 Thread Bruce Ferrell
Excellent suggestion and exactly what I did moments before it came in. Thanks all On 4/5/16 9:50 AM, Geoffrey Rommel wrote The general rule for using parameter markers ('?'s) is that a parameter marker can appear wherever a literal can appear. (As far as I know, this is true in any

Re: suppress quoting in prepared sql

2016-04-05 Thread Geoffrey Rommel
The general rule for using parameter markers ('?'s) is that a parameter marker can appear wherever a literal can appear. (As far as I know, this is true in any ANSI-compliant database; it goes back to the early years of DB2 and SQL/DS.) The substituted parameters are equivalent to literals. Hence,

RE: suppress quoting in prepared sql

2016-04-05 Thread Vaughan, Mark
From the DBI documentation (https://metacpan.org/pod/DBI#Placeholders-and-Bind-Values): Also, placeholders can only represent single scalar values. For example, the following statement won't work as expected for more than one value: "SELECT name, age FROM people WHERE name IN (?)"# wrong

Re: suppress quoting in prepared sql

2016-04-05 Thread Wm Mussatto
On Tue, April 5, 2016 09:24, Bruce Ferrell wrote: > I'm generating a sql statement like this: > > sth = $mysql_dbh->prepare( > "select sum(column) as columnSum from table where value in ( ? ) and > row_date between cast( ? as date) and cast( ? as date) "); > > sth->execute( $ValueIDs