Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^2: DBI place holder for sub query problem

by Anonymous Monk
on Jan 02, 2008 at 16:52 UTC ( #660005=note: print w/replies, xml ) Need Help??

in reply to Re: DBI place holder for sub query problem
in thread DBI place holder for sub query problem

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

Replies are listed 'Best First'.
Re^3: DBI place holder for sub query problem
by jettero (Monsignor) on Jan 02, 2008 at 18:09 UTC
    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.


Re^3: DBI place holder for sub query problem
by olus (Curate) on Jan 02, 2008 at 22:06 UTC
    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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://660005]
[LanX]: AnomalousMonk: yeah the asteroid but not the god, right?
[jedikaiti]: :-)
[AnomalousMonk]: LanX: Of course the asteroid! There is/are no god(s).
erix suddenly wants to hear My Sweet Lord once more

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (17)
As of 2017-11-22 17:17 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (327 votes). Check out past polls.