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