I get a "No text was entered for a check constraint named..." error whenever I try to alter one of my tables in TOAD in the Alter Table tab. I don't get an error if I create the alter statement manually and run it.
can you send the script to create the table, constraints, and indexes?
Also, please let me know what version of Oracle and Toad you are using.
Thanks
I am using version 13.1.0.78. The problem is not with running script, it is when you alter a table from the schema browser (tried to attach a screen print but it didn't work). It appears to only happen when there are columns that cannot be null, which have check constraints to enforce that.
Hi,
Right, I understand what you are saying regarding when it happens. I just want to try to reproduce it with your table. So, can you send me the script to create your table (or any table that will reproduce this)?
thanks
-John
Here is the script:
CREATE TABLE TEST
(
ITEM_NBR NUMBER(5),
AFFILIATE_NBR NUMBER(5)
);
CREATE UNIQUE INDEX TEST_NDX ON TEST
(ITEM_NBR);
ALTER TABLE TEST ADD (
CHECK ()
ENABLE VALIDATE
, CHECK ()
ENABLE VALIDATE);
Your constraints are not valid. There should be something inside the parens.
The text inside the parens is missing due to what I consider to be a bug in some versions of Oracle, where the SEARCH_CONDITION_VC column of DBA_CONSTRAINTS is null when it should not be. Oracle added this column in recent versions, but sometimes we still have to look in the SEARCH_CONDITION column.
In 13.1, you can add an entry to Toad.ini to work around it.
- Go to Toad Options -> General
- Click the"Open Folder" button on the right. A Windows Explorer window will open.
- Close Toad.
- In the Explorer window, browse down to the "User Files" folder.
- Open the "Toad.ini" file in that folder with notepad
- under [SETTINGS], add the following: SEARCH_CONDITION_WORKAROUND=1
- Save and close Toad.ini.
- Restart Toad and it should work.
These steps are not necessary in Toad 13.2 and newer. When the problem first occurred, I thought this was going to be an isolated case but it turned out to happen more often than I thought.
Yes it does, thanks!