in reply to DBI DBD::ODBC, Create a table, drop its constraints, then recreate it again!
Since you are only fetching one column, you can replace the prepare/execute/fetch with just (and since all the rows will be fetched, the statement won't stay "busy"):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/); $dbh_tmp->do("ALTER TABLE $tbl DROP CONSTRAINT $rel"); }
my $temp = $dbh->selectcol_arrayref($your_sql_statement);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: DBI DBD::ODBC, Create a table, drop its constraints, then recreate it again!
by blackadder (Hermit) on Nov 25, 2009 at 14:51 UTC |