Hi!
>>>>> "Eric" == Eric Moore <evmoore@stripped> writes:
Eric> Sasha,
Eric> Thanks for the response. I tried the following and still received the
Eric> error 1100 message:
Eric> "DBD::mysql::st execute failed: Table 'a' was not locked with LOCK TABLES
Eric> at..."
Eric> ---Revised Code---
Eric> sub InsertTermCourseList()
Eric> {
Eric> # First Lock the tables
Eric> my $InsStr = "LOCK TABLES
Eric> table_alpha WRITE,
Eric> table_bravo WRITE,
Eric> table_charlie WRITE";
Eric> my $rv = $main::dbh->do($InsStr)
Eric> or die "Can't Execute $InsStr: $main::dbh->errstr\n";
Eric> # Delete all 'old' courses
Eric> $InsStr = "SELECT a.id
Eric> FROM table_alpha a,
Eric> table_bravo b,
Eric> table_charlie c
Eric> WHERE a.student_id = $student_id and
Eric> c.acyear_acterm_id = $acyear_acterm_id and
Eric> b.acyear_acterm_time_id = c.id and
Eric> a.course_acyear_acterm_time_id = a.id";
Fix:
Change the LOCK TABLES entry to:
LOCK TABLES table_alpha as "a" WRITE,
table_bravo as "b" WRITE,
table_charlie as "c" WRITE";
The MySQL manual explains why!
Regards,
Monty