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

  • Home
  • SEARCH
  • 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 667571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:56:36+00:00 2026-05-13T23:56:36+00:00

This (from body of a stored proc) is throwing a syntax error: IF (name

  • 0

This (from body of a stored proc) is throwing a syntax error:

  IF (name = in_name)
          SET out_id = temp;
  ELSE
          LOCK TABLE People WRITE;
          INSERT INTO People (Name)
          VALUES (in_name);
          UNLOCK TABLE;
          SELECT LAST_INSERT_ID() INTO out_id 
  END IF

do I have to lock any tables I need at the start of the SP?

  • 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-05-13T23:56:37+00:00Added an answer on May 13, 2026 at 11:56 pm

    THEN is missing: IF (name = in_name) THEN

    But why do you want to lock the table? In this example it doesn’t make sense at all, it will just kill overall performance because nobody else can do anything with the table. And the lock doesn’t add anything. I don’t see the point, but maybe you didn’t tell us everything. 😉

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

Sidebar

Related Questions

If I have this stored proc definition minus the body ALTER PROCEDURE sp_AlloctionReport(@where NVARCHAR(1000),
This page from Adobe says to add a wmode parameter and set its value
I am having issues executing a SQL statement from a stored proc having single
Has anyone seen this error when trying to call an external C function from
I see this from time to time and want to know what it is.
I've got a couple django models that look like this: from django.contrib.sites.models import Site
Are there any compatibility issues that would prevent this from working? Do I need
Supposedly, it is possible to get this from Google Maps or some such service.
Using instance methods as callbacks for event handlers changes the scope of this from
I've been searching around, and I haven't found how I would do this from

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.