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 8961753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:58:02+00:00 2026-06-15T15:58:02+00:00

I have a database table which gets updated by a process from time to

  • 0

I have a database table which gets updated by a process from time to time. However, in some cases, I would like to enforce overrides to specific rows. Is there a way that I can without writing a lot of code to handle overrides, etc, just lock a row or field in the database itself?

For example, my table looks like

STUDENT | TEST_SCORE_AVG | HOMEWORK_AVG
John    |       92.3     |     88.8
Lisa    |       77.4     |     99.8 
Terry   |       88.0     |     64.5

With every new test or homework assignment, the student’s averages will change. However, say the teacher is John’s mother, and no matter what, he gets a 100.0 on his homework average. Is there a way to lock that in so that any program trying to change the value will get bounced back? I am using MySQL workbench to access my MySQL database (InnoDB)

UPDATE:

I could also make due with a function that locks the full row – meaning that neither TEST_SCORE_AVG nor HOMEWORK_AVG could ever be changed. I need the solution to persist over a long period of time, regardless of if the connection is lost. I want to lock the row until such time that I otherwise unlock it

  • 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-15T15:58:03+00:00Added an answer on June 15, 2026 at 3:58 pm

    No, there’s no practical way to prevent a single value in a single row from ever changing.

    Using just about anything besides MySQL, you could create a CHECK() constraint that guarantees John’s homework average is always 100, but I wouldn’t call that practical. On MySQL, you’d have to use a trigger to get the same feature, but again I wouldn’t call that practical.

    Other answers refer to row-level locking, which really has nothing to do with preventing a single value in a single row from changing.

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

Sidebar

Related Questions

--I have some rows from my table which I would like to export in
I have a php code which gets location information from database (test) and table
I have a database of events which gets updated every night. A single event
I have one database table which contains 8 columns. One of the columns is
I have a database table which link locations together; a location can be in
I have a database table which is full-text indexed and i use the CONTAINS-function
I have a database table A which stores records, A has a primary key
In an application we are developing, I have access to a database table which
i have a large mysql database table in which one column contains values ranging
I have a database table named 'student' in which there is one column named

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.