Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: DBI prepare() vs do() usage

by perlygapes (Sexton)
on Aug 01, 2020 at 01:02 UTC ( [id://11120165]=note: print w/replies, xml ) Need Help??


in reply to DBI prepare() vs do() usage

I came across this thread because I am looking for an answer to a problem I am having with the following code:

# update using the dbh handle my ($query, @bind) = $sqla->update( 'mytable', { field2 => $field2_new2 }, { field2 => $field2_new1 }, ); $dbh->do($query, undef, @bind);

Everytime I try to debug this in eclipse EPIC it keeps throwing this error:
Can't call method "do" on an undefined value at C:/Users/user/eclipse- +workspace/myproject/example.pl line 73, <__ANONIO__> line 3.

Given the use of undef is supposedly required, does anyone have any idea as to why I see this error?

Grats

Replies are listed 'Best First'.
Re^2: DBI prepare() vs do() usage
by LanX (Saint) on Aug 01, 2020 at 01:12 UTC
    please check if $dbh is defined .

    And it's unfortunate you replied to an mostly unrelated thread.

    New questions should start new threads.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Log In?
Username:
Password:

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

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

    No recent polls found