DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: dynamic constraints

  1. #1
    Join Date
    Feb 2000
    Location
    New York,U.S.A.
    Posts
    245
    Hi,
    I have a situation here, I have a table with multiple columns, column A of the Table is mostly nullable, but sometimes based on the certain circumstances, if colume B has certain values, column A has to be not null. Is there anyway I can set up such constraint at table creation level? Or is there any dynamic way to change the column from null to not null or from not null to null? Thanks for help.


  2. #2
    Join Date
    Dec 2000
    Posts
    75
    You can create a trigger after inserting or updating column B to also populate a value for column A as well. In case of a one shot for updating your existing column A to not null values, depending on your business rules, a sql block or a simple PL/SQL block will do the job, then use a new trigger to enforce the business rule.
    goodhealth

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width