Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: DBI place holder for sub query problem

by jettero (Monsignor)
on Jan 02, 2008 at 16:36 UTC ( #659998=note: print w/ replies, xml ) Need Help??


in reply to DBI place holder for sub query problem

The DBI handles the quoting on it's own (the reason you use the place holders)... Perhaps this'll work better?

$sth=$dbh->prepare("Update Customers set RESULTS =? where rec_no=?");

-Paul


Comment on Re: DBI place holder for sub query problem
Download Code
Re^2: DBI place holder for sub query problem
by Anonymous Monk on Jan 02, 2008 at 16:52 UTC
    Thank you for your input, but when I tried it I get
    DBD::Oracle::st execute failed: ORA-01722: invalid number (DBD ERROR: +error possibly near <*> indicator at char 30 in 'Update Customers set + RESULTS =:<*>p1....
    is this because it is a sql string and not a number. The sqlstring, when executed alone returns a number. TIA
      If it's not a bind variable then it's not a bind variable. The bind vars get meta-quoted automagically, sql probably should not be, so I don't think you can use a bind variable to do that job.

      -Paul

      If you are using a sub-query then the parenthesis are needed. Just omit the single quotes.
      $sth=$dbh->prepare("Update Customers set RESULTS = (?) where rec_no = +?");
      From the error message, it seems like you are assigning RESULTS with something like SELECT.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (15)
As of 2014-08-28 16:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (264 votes), past polls