Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: I seek DBI wisdom concerning bind parameters

by sundialsvc4 (Abbot)
on Oct 22, 2015 at 18:38 UTC ( #1145673=note: print w/replies, xml ) Need Help??


in reply to I seek DBI wisdom concerning bind parameters

What I do not see in your snippet-jungle is ... any bind-parameters actually being supplied.   The call expects an arrayref, not a scalar.

The sequence should be:

  • Prepare a statement which has placeholders, to obtain a statement handle.
  • Execute that statement handle one or more times, passing an arrayref of the bind-parameter values as its only parameter, to obtain a result-set that you can then iterate.   If there is only one parameter, the array contains only one entry but it’s still an array, and so on.

Your example is so “snippet-ed” that it’s hard to see where you are going wrong, but my guess is the argument for execute.   Or that the wrong SQL statement is being executed?

  • Comment on Re: I seek DBI wisdom concerning bind parameters

Replies are listed 'Best First'.
Re^2: I seek DBI wisdom concerning bind parameters
by fishmonger (Chaplain) on Oct 22, 2015 at 19:36 UTC

    The call expects an arrayref, not a scalar.

    Wrong. According to the module documentation and my own production code, the call accepts scalars or an array not arrayrefs.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1145673]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2019-04-24 06:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I am most likely to install a new module from CPAN if:
















    Results (121 votes). Check out past polls.

    Notices?