Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Erroring when opening second db link

Erroring when opening second db link

Erroring when opening second db link

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),

CODE --> 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
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.

RE: Erroring when opening second db link

is the database closed out before the next call?

I'm using DBD::mysql


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

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

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.



http://www.setapartgraphics.com/Free_Scripts/ Code Snippets just because

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close