Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: output results from sql join

by cavac (Curate)
on Oct 02, 2018 at 07:08 UTC ( #1223386=note: print w/replies, xml ) Need Help??


in reply to output results from sql join

Other already figured out the problem. BUT there is another big one in your script: Your are not checking the return codes from the database calls. You should always check prepare() and execute() worked without error - not doing it will result in you banging your head against the wall sooner or later.

Just saying...

"For me, programming in Perl is like my cooking. The result may not always taste nice, but it's quick, painless and it get's food on the table."

Replies are listed 'Best First'.
Re^2: output results from sql join
by afoken (Canon) on Oct 02, 2018 at 19:18 UTC
    BUT there is another big one in your script: Your are not checking the return codes from the database calls.

    And that's usally not needed IF you use RaiseError:

    my $dbh=DBI->connect( $dsn, $user, $pass, { RaiseError => 1, PrintError => 0, AutoCommit => 1, } );

    Any failing DBI method will automatically raise an error (i.e. die), no extra code required. See also DBI.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2021-02-27 15:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?