Toad World® Forums

Duplicate Check Constraint Generated


#1

I’m using Toad’s Export->Generate Schema Script feature.
I’m getting a duplicate check constraint statement. I specified separate
Alter statements because the duplicate check constraint in a single Alter
statement was causing the entire statement to fail.

SQL> ALTER TABLE PORTFOLIO_CROSS_TOTALING ADD (

2 CONSTRAINT CHK_PORTFOLIO_CROSS_TOTALING_1

3 CHECK (CASE

4 WHEN effective_date

5 close_date

6 THEN

7 0

8 ELSE

9 1

10 END = 0));

Table altered.

SQL>

SQL> ALTER TABLE PORTFOLIO_CROSS_TOTALING ADD (

2 CONSTRAINT CHK_PORTFOLIO_CROSS_TOTALING_1

3 CHECK (CASE

4 WHEN effective_date

5 close_date

6 THEN

7 0

8 ELSE

9 1

10 END = 0));

CONSTRAINT CHK_PORTFOLIO_CROSS_TOTALING_1

ERROR at line 2:

ORA-02264: name already used by an existing constraint

As you can see, I’m referencing two columns in the check constraint. I
believe that is why Toad generates two statements; one per column. When I check
the Data Dictionary, I only see the check constraint in there once.

My workaround is to edit out the duplicate check constraint statement. But Toad
should be smart enough to notice the duplicate statement and suppress it.

Dan Clamage

Oracle Database Developer

C O N F L U E N C E

412.246.1806 direct

412.802.8632 main

412.802.8647 fax

THE MATERIAL CONTAINED IN THIS MESSAGE IS CONFIDENTIAL AND IS SUBJECT TO
RESTRICTIONS ON ITS DISCLOSURE. The recipient acknowledges that the information
contained herein is the exclusive, proprietary and confidential property of
Confluence Technologies, Inc. and shall be at all times regarded, treated and
protected as such by the recipient. The use and disclosure of this information
is subject to the restrictions contained in the Software License Agreement
between the recipient (or the recipient’s employer or its affiliates) and
Confluence Technologies, Inc.


#2

Hi Dan,

I believe this one was fixed in the beta a few months ago. It was a tough one to
reproduce – if you go to SB-Tables-Script, the script comes out correctly.
It only happens in generate schema script, when you have a constraint like this
that just happens to fall in a certain place in our processing of query results.

If you can, will you please try the beta to confirm the fix for me? If
it’s still broken, I’ll dig deeper.

-John


#3

John,

Where can I download the Toad beta from?

I have to say, as a software vendor, you guys are very responsive.

Dan Clamage

Oracle Database Developer

C O N F L U E N C E

412.246.1806 direct

412.802.8632 main

412.802.8647 fax

THE MATERIAL CONTAINED IN THIS MESSAGE IS CONFIDENTIAL AND IS SUBJECT TO
RESTRICTIONS ON ITS DISCLOSURE. The recipient acknowledges that the information
contained herein is the exclusive, proprietary and confidential property of
Confluence Technologies, Inc. and shall be at all times regarded, treated and
protected as such by the recipient. The use and disclosure of this information
is subject to the restrictions contained in the Software License Agreement
between the recipient (or the recipient’s employer or its affiliates) and
Confluence Technologies, Inc.


#4

Thanks Dan.

To run the beta, you need to have Toad 10 installed first.

http://www.toadfororacle.com/beta.jspa

There are 2 links down at the bottom. One is the beta installer. You’ll
have to do that one first. After that is done, then click the ‘beta
update’ link, right under the first one. That will get you the most recent
beta. Updates usually come out on Mondays and Thursdays.

-John


#5

John,

I installed Toad 10.5 Beta. The duplicate check constraint has been corrected.

Thanks,

Dan Clamage

Oracle Database Developer

C O N F L U E N C E

412.246.1806 direct

412.802.8632 main

412.802.8647 fax

THE MATERIAL CONTAINED IN THIS MESSAGE IS CONFIDENTIAL AND IS SUBJECT TO
RESTRICTIONS ON ITS DISCLOSURE. The recipient acknowledges that the information
contained herein is the exclusive, proprietary and confidential property of
Confluence Technologies, Inc. and shall be at all times regarded, treated and
protected as such by the recipient. The use and disclosure of this information
is subject to the restrictions contained in the Software License Agreement
between the recipient (or the recipient’s employer or its affiliates) and
Confluence Technologies, Inc.


#6

Glad to hear it, thanks for the update.