Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: DBI reports too many bind variables

by dbwiz (Curate)
on May 24, 2005 at 20:29 UTC ( #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
Node Status?
node history
Node Type: note [id://460155]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2020-10-20 16:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (210 votes). Check out past polls.

    Notices?