Link to home
Start Free TrialLog in
Avatar of rmtye
rmtye

asked on

I Don't understand error: ORA-01735: invalid ALTER TABLE option

I'm trying to use the exceptions option to discover which row is causing an error when I try to create a constraint; but, I'm getting an error I don't understand.

Any insights?

SQL> ALTER TABLE "RT_TEST"."SVC_LINE_CAS_ALLOC" ADD CONSTRAINT "CCL0B500" FOREIGN KEY
  2  ("FK_CLAIM_ID", "FK_SERVICE_NBR", "FK_SVC_SEQ_NBR") REFERENCES "RT_TEST"."SERVICE_LINE"
  3  ("FK_CLAIM_ID", "SERVICE_NUMBER", "SEQUENCE_NUMBER") ON DELETE CASCADE DISABLE
  4  exceptions into exceptions;
exceptions into exceptions
*
ERROR at line 4:
ORA-01735: invalid ALTER TABLE option
Avatar of Jinesh Kamdar
Jinesh Kamdar
Flag of India image

Is ur exception table named as "exceptions" ? If yes, try after renaming it to "tb_exceptions" and see if it works.
Excerpt from Oracle 10 g Documentation on the ALTER TABLE syntax :

exceptions_clause : This clause is valid only if the partitioned table has been defined with a UNIQUE constraint, and that constraint must be in DISABLE VALIDATE state. Specify a table into which Oracle Database places the rowids of all rows violating the constraint. If you omit schema, then the database assumes the exceptions table is in your own schema. If you omit this clause altogether, then the database assumes that the table is named EXCEPTIONS. The exceptions table must be on your local database.

You can create the EXCEPTIONS table using one of these scripts:

UTLEXCPT.SQL : uses physical rowids. Therefore it can accommodate rows from conventional tables but not from index-organized tables. (See the Note that follows.)

UTLEXPT1.SQL : uses universal rowids, so it can accommodate rows from both heap-organized and index-organized tables.

If you create your own exceptions table, then it must follow the format prescribed by one of these two scripts.

If you are collecting exceptions from index-organized tables based on primary keys (rather than universal rowids), then you must create a separate exceptions table for each index-organized table to accommodate its primary key storage. You create multiple exceptions tables with different names by modifying and resubmitting the script.
Avatar of sonicefu
ORA-01735:      invalid ALTER TABLE option
Cause:      An invalid option was specified in an ALTER TABLE statement.
Action:      Check the statement syntax, specify a valid option, and retry the statement.

ALTER TABLE rt_test.svc_line_cas_alloc
ADD CONSTRAINT ccl0b500 FOREIGN KEY
(fk_claim_id, fk_service_nbr, fk_svc_seq_nbr) REFERENCES rt_test.service_line
(fk_claim_id, service_number, sequence_number)
ON DELETE CASCADE
DISABLE
EXCEPTIONS --<----problems is here
 INTO EXCEPTIONS;
ALTER TABLE rt_test.svc_line_cas_alloc
ADD CONSTRAINT ccl0b500 FOREIGN KEY
(fk_claim_id, fk_service_nbr, fk_svc_seq_nbr) REFERENCES rt_test.service_line
(fk_claim_id, service_number, sequence_number)
ON DELETE CASCADE
;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of johnsone
johnsone
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial