469,337 Members | 6,009 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,337 developers. It's quick & easy.

DBI: Is there an "unbind" method?

BeemerBiker
I added a temporary column to a database and want to delete it after I am finished with it. However, I cannot remove the column while it is still bound to a variable.

I tried $sth->finish() but that didnt do anything
$dbh->disconnect() works but I have to reconnect before I can remove the column. Google seems to indicate there is no unbind. The following code snippet works. Note: TestSource("NEW") does a connect to the "new" database and assignes $dbh.

Expand|Select|Wrap|Line Numbers
  1.    TestSource("NEW");
  2.    $sth = training::RunSql($dbh, "SELECT [Employee ID],TempDept, TempPrivilege FROM EmployeeInfo;");
  3.    $sth->bind_columns(\$eid, \$dept, \$priv);
  4.    while($sth->fetch())
  5.    {
  6.     ...blah blah blah...
  7.    }
  8.    $dbh->disconnect();
  9.    TestSource("NEW");
  10.    training::RunSql($dbh,"ALTER TABLE EmployeeInfo DROP COLUMN TempDept;");
  11.    training::RunSql($dbh,"ALTER TABLE EmployeeInfo DROP COLUMN TempPrivilege;");
  12.  
Feb 26 '09 #1
1 2573
KevinADC
4,059 Expert 2GB
The place to look is in the DBI modules documentation. Personally I don't know if there is or isn't.
Feb 26 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

24 posts views Thread by Hung Jung Lu | last post: by
1 post views Thread by Phil Schmidt | last post: by
2 posts views Thread by Randy Harris | last post: by
3 posts views Thread by jayderk | last post: by
2 posts views Thread by KC | last post: by
29 posts views Thread by Gerald | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.