Buongiorno beloved Monks,
I'm connecting to M$$QL2008 server! using DBI,DBD::ODBC
I have this bit of code that searches for Constraints in a given table and then deletes them;
my $sth = $dbh->prepare("SELECT constraint_name FROM information_s
+chema.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 = $dbh->prepare("ALTER TABLE Data_CentersTEST DROP CONS
+TRAINT $rel");
$th->execute;
}
All works well untill I actually try to delete the constraint! Perl throughs this error
DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server Driver]Conne
+ction is busy with results for another hstmt (SQL-HY000) at
U:\Doccuments\Scripts\Test\sql_do3.pl line 78.
searched google but couldn't find anything definite! Can someone shine a light on this please?
Thanks a lot!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.