Re: Clarification on DBI module
- From: hjp@xxxxxxxxx (Peter J. Holzer)
- Date: Thu, 10 May 2007 14:50:10 +0200
On 2007-05-10 07:50:16 -0400, Jeffrey Seger wrote:
On your execution without a bound value, are you actually looking for rows
where the empno column is null? If so, try this:
instead of
my @bind1 = ();
try:
my @bind1 = (undef);
Otherwise, what exactly are you looking for?
As I understood Ramesh, the code wasn't supposed to do anything useful.
He expected an error (e.g. "DBD::Oracle::st execute failed: called with
0 bind variables when 1 are needed"), but instead got a result.
While the behaviour is documented (if you read closely enough), and also
useful, it is somewhat surprising:
When you use 2 placeholders in your query, and then invoke execute with
1 or 3 parameters, you get an error, that the number of bind variables
doesn't match the prepared query. But if you invoke execute with 0
parameters, you don't get such an error.
I don't see how this behaviour could be changed without breaking
existing code, though.
hp
--
_ | Peter J. Holzer | If I wanted to be "academically correct",
|_|_) | Sysadmin WSR | I'd be programming in Java.
| | | hjp@xxxxxxxxx | I don't, and I'm not.
__/ | http://www.hjp.at/ | -- Jesse Erlbaum on dbi-users
Attachment:
pgpst8wwmzgdB.pgp
Description: PGP signature
- Follow-Ups:
- Re: Clarification on DBI module
- From: Tim Bunce
- Re: Clarification on DBI module
- References:
- Re: Clarification on DBI module
- From: John Scoles
- Re: Clarification on DBI module
- From: Ramesh Thangamani
- Re: Clarification on DBI module
- From: Jeffrey Seger
- Re: Clarification on DBI module
- Prev by Date: Re: DBI compilation errors
- Next by Date: Re: Clarification on DBI module
- Previous by thread: Re: Clarification on DBI module
- Next by thread: Re: Clarification on DBI module
- Index(es):