in reply to Sqlite DBI $sth->rows

I have to say that even though this is a FAQ, it is a good question, because DBI is unreliable on this one. I have had DBI return rows one time and then return -1 on the exact same query if it was run without disconnecting and reconnecting. I wish I knew enough about the module to help fix this, but apparently it has been like this for a long time. People have reported the issue, it just isn't going to get fixed I suppose :-(

# I am on Win32- Perl 5.8 - DBI -1.37 DBD::ODBC -1.06
Here is another one to watch out for
my $sql = qq( use customers select * from customers );
If you embed a "USE" inside a complex query and then prepare and execute it via ODBC... you will get zip back and usually an accompanied "Invalid Cursor" message from ODBC. The work-around is to NOT insert a USE statement or to extract the "USE STATMENT" and prepare and execute it SEPERATELY from the rest of the SQL... uggh! You can do this on other platfroms as written, just not via DBI. :-(
Cheers,
JamesNC