Check Constraint Text Error

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.

  1. Go to Toad Options -> General
  2. Click the"Open Folder" button on the right. A Windows Explorer window will open.
  3. Close Toad.
  4. In the Explorer window, browse down to the "User Files" folder.
  5. Open the "Toad.ini" file in that folder with notepad
  6. under [SETTINGS], add the following: SEARCH_CONDITION_WORKAROUND=1
  7. Save and close Toad.ini.
  8. 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!

1 Like