Print Page | Close Window

SQL Help...

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=3765
Printed Date: 29 March 2026 at 10:54pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: SQL Help...
Posted By: kashirat
Subject: SQL Help...
Date Posted: 23 June 2003 at 10:25am
Hi,

I'm trying to get a few constraint checks on a table but I'm not sure how to implement it. Heres what its supposed to do:

I have a table Connection with attributes ipA portA ipB portB. A particular connection is two way, but I don't want to add a connetion twice, since it would be redundant. The connection on a particular ip/port can only happen once though (obviously).

So, to make sure that this condition is held I need to check that ipA portA among all values in those 2 columns are unique (which can be done just with a unique constraint) but, I also need to check that the ip and port is not in ipB portB either..

Could anyone give me a hand? I don't know how to implement this. Could it be done with a check constraint in the table creation?

Thanks.

Darren



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net