Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8295095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:27:49+00:00 2026-06-08T14:27:49+00:00

My app consists of a function in which I’m trying to lock a table,

  • 0

My app consists of a function in which I’m trying to lock a table, update it (using a stored procedure) and then unlock it. The code goes something like:

LOCK TABLE mytable WRITE;
CALL myStoredProc;
UNLOCK TABLES;

When the function is called, it errors out when the CALL myStoredProc; part is executed giving the following error message:

Table 'proc' was not locked with LOCK TABLES

I tried locking mysql.proc along with mytable but that didn’t seem to help. Any ideas on this type of scenario?

Update:
The first stored procedure goes as follows:

CALL mystoredproc2(NOW());
UPDATE mytable SET _column = NOW();
SELECT * FROM mytable WHERE _column > NOW();

As you see, the above stored procedure nests another one. The second one simply contains an update statement:

UPDATE mytable2 SET _column = _now;

FYI: I’ve also locked mytable2 in the lock statement but that doesn’t work either.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T14:27:50+00:00Added an answer on June 8, 2026 at 2:27 pm

    I moved the nested mystoredproc2 stored procedure outside the mystoredproc as a series of SQL statements and that did the trick.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a iPad ordering web app at the moment which consists
I am writing Qt-based app with Blender-like functionality. It consists of a 'framework' which
This question is in regards to UIView's -drawRect function. The Set-Up: My app consists
I have a C# app for which I've written GDI+ code that uses Bitmap/TextureBrush
My web app consists of images stored in the SQL Server db. And, i
I have a webview app tool, which essentially consists of the webview and two
My WPF app consists of a NavigationWindow , and then a set of Page
My app consists of 3 views. I've defined 3 helper methods in the AppDelegate
I'm creating an app that uses ActionBarSherlock. The app consists of three tabs, and
I'm developing HTML5 application for a tablet. Idea is as follows: app consists of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.