[rt.cpan.org #36395]



Queue: DBI
Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=36395 >

On Tue Jul 01 01:37:00 2008, RTHANGAM wrote:
On Tue Jun 24 17:17:23 2008, TIMB wrote:
The DBI is acting as defined. It's not a bug.
You should avoid using an array to pass arguments to execute().

I could still see the following examples mentioned in the documentation
in CPAN where we are passing an array to execute method(). Please
comment on this.

$rv = $sth->execute or die $sth->errstr;
$rv = $sth->execute(@bind_values) or die $sth->errstr;

I was too terse in my reply. If you use an array to pass arguments to execute() you should
take care that the number of elements in the array matches the number of placeholders.

I've added a note to the docs:

Note that passing C<execute> an empty array is the same as passing no arguments
at all, which will execute the statement with previously bound values.
That's probably not what you want.

Tim.
.



Relevant Pages

  • Re: I dont understand the definition of DOES>
    ... on stack on code entry). ... You can use DOES to make ARRAY and then use ARRAY ... CREATE CELLS ALLOT ... First you'd make the code that will execute on the child word. ...
    (comp.lang.forth)
  • Re: Special characters and superscripts in PostScript and EPS
    ... When does one use bind def and load def? ... what you actually are doing is creating an executable array on the stack ... When you execute the array, if it contains any names the interpreter ... The 'load' operator searches dictionaries looking for a named value. ...
    (comp.lang.postscript)
  • Re: Space leak in Haskell code
    ... prettiness, here's another solution. ... It's 2-3 times slower than C++, ... code the recursion in execute'. ... access the array, or using unsafeAt, but the first won't work in my ...
    (comp.lang.functional)
  • Re: Code wont execute Main Macro Calls - non breaking spaces
    ... I am going to attach my first array which is the same as you have ... So each macro will execute one after the other. ... separated each find string and each replace string for the sake of ...
    (microsoft.public.word.vba.general)
  • RE: Help in translation
    ... I am an author of User-defined string functions. ... EXECUTE() - Execute the commands from a string, ... ARRAYSUM- Totals all or specified numeric elements in the selected column ... elements in the selected column of an array. ...
    (microsoft.public.fox.helpwanted)