Not all databases like to have two active statements at the same time. For this type of problem, I find it better to create two connections to the database.
...roboticusmy $db1= first connection my $db2= second connection ... my $sth = $db1->prepare("SELECT constraint_name FROM information_schem +a.constraint_column_usage WHERE TABLE_NAME = '$tbl'"); $sth->execute; my $temp = $sth->fetchrow_arrayref; foreach my $rel (@$temp) { next unless ($rel =~ /ID/); print "Relationship: $rel\n"; my $th = $db2->prepare("ALTER TABLE Data_CentersTEST DROP CONSTRAI +NT $rel"); $th->execute; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt
by blackadder (Hermit) on Nov 11, 2009 at 14:34 UTC |