Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: output results from sql join

by cavac (Parson)
on Oct 02, 2018 at 07:08 UTC ( [id://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 (Chancellor) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1223386]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-25 20:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found