asafp has asked for the wisdom of the Perl Monks concerning the following question:
And then I bind the values using the following code:my $query = "INSERT INTO $table_name (F1,F2,F3...) VALUES (?,?,?,...)" +;
Now, I get the followong DBA error:my $sth = $dbh->prepare($query); my @params = @$bind_params; my ($i,$j); for ($i = 0,$j=1; $i <= $#params;$i++,$j++){ $sth->bind_param($j,$params[$i]); } $sth->execute();
ORA-01858: a non-numeric character was found where a numeric was expec +ted (DBD ERROR: error possibly near <*> indicator at char 173 in 'INS +ERT INTO user_session (auth_id,expiry_date,remote_address,num_days,ve +rification,creation_date,login_id,inst_code,handle,last_update_date) +VALUES (:p1,:p2,:p3,:p4,:p5,:<*>p6,:p7,:p8,:p9,:p10)') [for Statement + "INSERT INTO user_session (auth_id,expiry_date,remote_address,num_da +ys,verification,creation_date,login_id,inst_code,handle,last_update_d +ate) VALUES (?,?,?,?,?,?,?,?,?,?)" with ParamValues: :p1="user1name", + :p10='sysdate', :p2='to_date('22-05-2011 23:59:59','DD-MM-YYYY HH24: +MI:SS')', :p3='il-pr01.corp.mygroup.com:8991/prs;10.1.116.190;', :p4= +0, :p5='fencpw('user1pass')',:p6='sysdate', :p7='user1name', :p8='USM +50', :p9="22520111126163902333386268343"]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI bind_param
by moritz (Cardinal) on May 22, 2011 at 09:42 UTC |