How to set constraint on table row


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: How to set constraint on table row

  1. #1
    Join Date
    Jun 2005
    Posts
    7

    How to set constraint on table row

    Hi,
    I have a table like given below:

    SectionName SectionCode IRN

    Production PROD 2001
    Electrical EL 4001
    Mill House M 5501
    EOT Crane M 5501
    Plant M 5501
    Motor Garage M 8001

    First Issue The IRN's of all the departments will be incremented one by one and reset to their original value at the start of new financial year. Can I set this using constraints? I know constraints are set on columns. I don't know whether its possible row-wise.

    Second Issue The sections Mill House, EOT Crane and Plant have same IRN range. For indent of any one of these sections, how I can I update the other two sections to the same value.

    Thanks for any help.

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    First Issue: Constraints are used for validation. I have the need to start fresh for a number of things at the beginning of each year. I have "roll over" stored procedures that I run, once a year, to accomplish this for me.

    Second Issue: I'm unclear what you are asking for.

    http://forums.devx.com/showthread.php?t=170699
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Jun 2005
    Posts
    7
    Quote Originally Posted by Hack View Post
    I have "roll over" stored procedures that I run, once a year, to accomplish this for me.
    I think I should create a stored procedure that will run automatically once a day(when the server starts). If the day happens to be 1st April, then IRN's of all the departments will be reset to their starting value. Can you please show me how to do it?

    I have solved the second issue. Again thanks.

  4. #4
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    What is your resolution for the second issue?

    It might help someone else with the same or similiar problem.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  5. #5
    Join Date
    Jun 2005
    Posts
    7
    I have solved both the issues. For first issue I have created a job that will update the IRN's if it happens to be 1st April. The second issue is specific to the application I am developing.

  6. #6
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Thanks.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. Replies: 2
    Last Post: 06-08-2002, 12:47 PM
  2. Set a filter in a databound table
    By Jim Donnelly in forum VB Classic
    Replies: 1
    Last Post: 02-13-2001, 11:45 AM
  3. No Backwards Fetching
    By Brian in forum VB Classic
    Replies: 3
    Last Post: 01-07-2001, 06:14 PM
  4. Ted, you're a prince!
    By Georgiana Trigg in forum VB Classic
    Replies: 0
    Last Post: 10-29-2000, 12:21 PM
  5. Multi-row calculations
    By Bob Hines in forum Database
    Replies: 7
    Last Post: 04-27-2000, 12:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center