Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^5: Multiple records fetches issue using DBD::ODBC in Perl

by Marshall (Canon)
on Apr 27, 2020 at 06:06 UTC ( #11116105=note: print w/replies, xml ) Need Help??


in reply to Re^4: Multiple records fetches issue using DBD::ODBC in Perl
in thread Multiple records fetches issue using DBD::ODBC in Perl

I learned something: If the number of rows affected is not known, then execute() returns -1. Usually with an SQL statement (UPDATE or whatever), the number of rows affected will be known. This is different because of the execution of a stored procedure.

In my experience, it is relatively easy to translate working command line SQL code into Perl code. I would like to see the command line SQL statements that are claimed to "work".

Update: As I wrote earlier, I've never seen -1 (unknown number of rows affected). A normal SQL UPDATE or INSERT knows that number. The DBI can return the string value of 0EO which evaluates to "true" in a scalar context but is numerically zero in a math context or a number representing the number of rows affected. As I learned, in this situation, a negative number could be returned.

I HIGHLY recommend that you work from the SQL command line to get a valid result. Once you have that, we can make Perl do the same thing. Once we are past that, other optimization can be done about error conditions. Start from known working SQL code. Make Perl do the same thing that you know works. Then go from there.

  • Comment on Re^5: Multiple records fetches issue using DBD::ODBC in Perl

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2022-05-21 00:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (76 votes). Check out past polls.

    Notices?