Limit the number of record in a table

5 pts.
Tags:
Query
Query Parameters
I want to limit the number of records that a user can input in a specific table. for instance, users should be able to subscribe to a race which are limited to 10 tracks.   I would i to have a clause or something that might help my to prevent users from exceeding the number of tracks available for the race and while the 10th competitor subscribes. no over competitor will be able to subscribe to this race.     I hope to be clear about my request and that someone will be able to help me.      Thanking you beforehand

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Without knowing what your table (or tables) looks like, we can't know how it might be limited. Also, it would help to know what database system you'll be using -- MS Access? SQL Server? DB2? Oracle? MySQL? Other? And what languages will any programming be done in? And what platform will it run on? Tom
    125,585 pointsBadges:
    report
  • BigKat
    without more information, assuming your DB will support triggers, the only thing we could suggest is that you would have to create a trigger that generated a lane number for each record in each race, and once it exceeded the limit, cancel the input
    8,330 pointsBadges:
    report
  • T8115378
    Surely a simple count (held in perhaps a DTAARA) and used as a maximum number will suffice.
    10 pointsBadges:
    report
  • TomLiotta
    Surely a simple count... I don't think I'd use a "simple count". I'd look to see how the database could return a value telling how many were subscribed. As subscriptions were created or deleted, the value would automatically increment or decrement. By using some separate object such as a data area, it'd be necessary to have something that would be guaranteed always to increment/decrement correctly. It might also be necessary to restrict some other process from modifying the object. How could you stop someone from running CHGDTAARA and simply setting the value? If we knew something about the DBMS and the general design of the tables/views, it might be easy to build the restriction into the database itself. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following