For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > April 2004 > RE: My DBI script wont UPDATE a Table!









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: My DBI script wont UPDATE a Table!
Jeroen Lodewijks

2004-04-02, 10:31 am

Do you have rights to update the table on the production database?

> -----Original Message-----
> From: Mark Martin [mailto:mark.martin@MAY.IE]
> Sent: 02 April 2004 14:53
> To: beginners@perl.org; dbi-users@perl.org
> Subject: My DBI script wont UPDATE a Table!
>
>
> Hi,
> I designed my application on a test database and it worked
> fine without commiting the database handle. But now when I've
> moved it to the production database my updates wont commit -
> even when I do issue a commit on the DBH?!?!
>
> while(certain condition) {
> $sql = qq{UPDATE table
> SET field=value} ;
> $sth = $dbh->prepare($sql) ;
> $sth->execute;
>
> $dbh->commit();
>
> }
> $sth->finish;
> $dbh->disconnect;
>
> I've tried the commit outside the while statement with no
> luck. Any ideas?
> Mark
>

Hardy Merrill

2004-04-02, 10:31 am

Paste in your database connect statement. Are you setting RaiseError,
PrintError, and AutoCommit? Which database are you using? Are you
doing any error checking of DBI statements? And as was just pointed out
by someone else, does the user you are connecting with have update
permissions in your production database?
[color=darkred]
Hi,
I designed my application on a test database and it worked fine without
commiting the database handle. But now when I've moved it to the
production database my updates wont commit - even when I do issue a
commit on the DBH?!?!

while(certain condition) {
$sql = qq{UPDATE table SET
field=value} ;
$sth = $dbh->prepare($sql) ;
$sth->execute;

$dbh->commit();

}
$sth->finish;
$dbh->disconnect;

I've tried the commit outside the while statement with no luck. Any
ideas?
Mark
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com