-
Another constraint question...
I need to do a table level constraint that does...
in the acct table...if acct_type is "1" then acct_bal must be > 0, if acc_type is "2" then acct_bal must be > 100, etc..
All the fields are within the same table.
Thanks,
Erik
-
write a trigger before insert for each row
It is better to ask and appear ignorant, than to remain silent and remain ignorant.
Oracle OCP DBA 9i,
C++, Java developer
-
I am not allowed to use a trigger for this part...this is a class assignment. I found out today that my entire class is stuck on the same part.
Thanks,
Erik
-
Code:
ALTER TABLE my_table ADD CONSTRAINT check_acct_bal
CHECK (acct_type = '1' AND act_bal > 0
OR
acct_type = '2' AND act_bal > 100
OR
etc....
);
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|