List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:May 9 2001 1:55pm
Subject:Re: Do I need to locak a file when foind a SELECT?
View as plain text  
When you lock tables, you must lock ALL tables you intend to read
or write.

You previously locked tables, and then did a select from bookings.
You did not include bookings in the lock.

Don Pro wrote:

> Hi,
> 
> As the subject states, I am getting an error in my Perl script telling
> me that a table is not locked yet all I am doing is a SELECT.  Why do I
> need lock a table in order to issue a SELECT?
> 
> The code in question is:
> 
> $sqlCmd = $dbh->prepare(q{
>                 SELECT Booking FROM Bookings where Booking = ?})
>           or die "Can't prepare select statement in Bookings:
> $DBI::errstr";
> $retCount = $sqlCmd->execute($booking)
>            or die "Can't execute select statement in Bookings:
> $DBI::errstr";
> 
> 
> The error message is:
> 
> DBD::mysql::st execute failed: Table 'Bookings' was not locked with LOCK
> TABLES
> at ./lclmail.pl line 435.
> Can't execute select statement in Bookings: Table 'Bookings' was not
> locked with
>  LOCK TABLES at ./lclmail.pl line 435.
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <mysql-thread73208@stripped>
> To unsubscribe, e-mail
> <mysql-unsubscribe-gerald_clark=suppliersystems.com@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-- 
Gerald L. Clark
gerald_clark@stripped

Thread
Do I need to locak a file when foind a SELECT?Don Pro7 May
  • Re: Do I need to locak a file when foind a SELECT?Gerald Clark9 May