Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Erroring when opening second db link

Status
Not open for further replies.

jcarrott

Programmer
May 28, 2009
130
US
I have opened the first connection and run a 'fetchrow_array'. When I used Perl on a UNIX/Oracle system I was able to link to other tables. I am now working on a Windows/SQL system and when I run this code (without the # at the start of the line),

Perl:
#       $st2 = $dbh->prepare("SELECT BIRTHDATE FROM PAEMPLOYEE WHERE
#           employee = '" . $vEmp . "'") or die "select 2: " . $dbh->errstr;
#       my @dat2;
line 113 -
#       my $r2 = $st2->execute or die "Couldn't execute 2: " . $st2->errstr;
#       while (@dat2 = $st2->fetchrow_array())
#       {
#           my $vDOB = $dat2[0];
#       }

I get an error,

DBD::ODBC::st execute failed: [Microsoft][SQL Server Native Client 10.0]Connecti
on is busy with results for another command (SQL-HY000) at hevnInter2_pl line 11
3.
Couldn't execute 2: [Microsoft][SQL Server Native Client 10.0]Connection is busy
with results for another command (SQL-HY000) at hevnInter2_pl line 113.
 
is the database closed out before the next call?

I'm using DBD::mysql

Perl:
$connection = DBI->connect('DBI:mysql:TABLE', 'root', 'password');

$query2 = "select loginhistory, logincount from useracounts where USERNAME = '$Values[1]'";
$statement = $connection->prepare($query2);
$statement->execute();

I have $connection as a sub function, and I run three to four of these (all to different tables) in a single sitting.

I'm not too sure how the DBD::ODBC::st is setup (I just started with mySQL two weeks ago) but if its anything like the DBD::mysql, it should work once the first call is closed out I would think, but I don't really know.

~Nate_Bro


Code Snippets just because
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top