is there anyway to get around this? this could case a lot of problems if someone by mistake switched the default database on the system dsn name!
--- "E. Scott Stricker" <[EMAIL PROTECTED]> wrote: > Getting the same thing with the newer versions of DBD-ODBC. The generic > behavior is that the software no longer seems to support batches. We've > had > the same problem with any sql statement containing multiple sql commands > (in > this case USE is the first and SELECT is the second). Used to work with > older software. > > E. Scott Stricker - NGIT @ Smartlink > ----- Original Message ----- > From: "Adam Peterson" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, March 26, 2003 4:59 PM > Subject: DBD-ODBC Strange Behavior? > > > > hello, > > > > i'm running my script on a win2000 box called eggpayorteam. i have > > established a ODBC system DSN name of "eggpayorteam" and have set the > > default database to "eggsupp". when i run my queries below i get > errors, > > noted further below. when i remove "use eggsupp" it runs fine. is this > > strange behavior? and why is this happening? > > > > sth = $dbh->prepare(" > > use eggsupp > > select count(fileid) as number from filesupp fs > > where datecreated >= '$past' and datecreated <= '$today' > > "); > > > > $sth->execute; > > > > while( my @data = $sth->fetchrow_array) > > { > > $total_num = $data[0]; > > print "$total_num\n\n\n"; > > } > > > > ###### query 2# > > > > $sth = $dbh->prepare(" > > use eggsupp > > select count(fileid), crashtypedescr > > from filesupp fs join crashtype ct on fs.crashtype = ct.crashtypeid > > where crashtype <> '' > > and datecreated >= '$past' and datecreated <= '$today' > > group by crashtype,crashtypedescr > > "); > > > > $sth->execute; > > > > --------------------- > > > > > > DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server > Driver]Invalid > > cursor > > state (SQL-24000)(DBD: dbd_describe/SQLNumResultCols err=-1) at > > C:\perl\scripts\ > > crash_pie.pl line 59. > > DBD::ODBC::st fetchrow_array failed: (DBD: no select statement > currently > > executi > > ng err=-1) at C:\perl\scripts\crash_pie.pl line 61. > > DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server > Driver]Invalid > > cursor > > state (SQL-24000)(DBD: dbd_describe/SQLNumResultCols err=-1) at > > C:\perl\scripts\ > > crash_pie.pl line 77. > > DBD::ODBC::st fetchrow_array failed: (DBD: no select statement > currently > > executi > > ng err=-1) at C:\perl\scripts\crash_pie.pl line 79. > > > > __________________________________________________ > > Do you Yahoo!? > > Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! > > http://platinum.yahoo.com > __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com