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 <[EMAIL PROTECTED]>
> To unsubscribe, e-mail 
><[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-- 
Gerald L. Clark
[EMAIL PROTECTED]


---------------------------------------------------------------------
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to