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

Re: DBI reports too many bind variables

by dbwiz (Curate)
on May 24, 2005 at 20:29 UTC ( [id://460155]=note: print w/replies, xml ) Need Help??


in reply to DBI reports too many bind variables

In addition to the useful advice of escaping your pipe character, I would also advise you to code defensively. i.e. check your data before passing it to the "execute" method.

my @player_rec = split /\|/; if (scalar(@player_rec) == scalar(@fields)) { if ($sth->execute(@player_rec)) { print "Worked, cool"; } else { print "Didn't work, uncool, error is: $DBI::errstr"; } } else { warn "incorrect number of fields at line $.\n"; warn sprintf("expected: %d but found %d\n",scalar(@fields), scala +r(@player_rec)); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-16 23:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found