Home » SQL & PL/SQL » SQL & PL/SQL » plz help me in knowing this
plz help me in knowing this [message #1422] Sun, 28 April 2002 12:22 Go to next message
pavani
Messages: 32
Registered: April 2002
Member
hi

i'm preparing for sql and pl/sql and so i',m going through certified professionalsql and pl/sql exam guide..in that i came throgh exceptions which i can't understand.

i know about the thing u told but i din't understood from that book any way thanks for u'r help

i'm providing the example from the book so if u can plz help me

create table example_1(col1 number);

table created

insert into example_1 values (10);

1 row created

insert into example_1 values (1);

1row created

alter table example_1 add (constraints pk_01 primary key (col1));

table altered

select * from example_1;

col1

10

1

alter table example_1 disable constraint pk_01;

tavble altered

insert into example_1 values (1);

1 row created

alter table example_1 enable constraint pk_01

exceptions into exceptions;

alter table example_1 enable constraint pk_01

error at line 1

ora-02437 : cannot enable (scott.pk_01) - primary key violated

----------------------------------------------------------------------------------------------------

in the above scrpit i din't understood exceptions into exceptions.

plz help me

thanks
Re: plz help me in knowing this [message #1437 is a reply to message #1422] Tue, 30 April 2002 10:30 Go to previous message
Jay Ramlakan
Messages: 11
Registered: April 2002
Junior Member
>"alter table example_1 enable constraint pk_01 exceptions into exceptions"
In this instance, there is a table called exceptions.
If there are rows that violate the constraint, those rows would be identifed by placing them (rowid's I think) into table exceptions.

The syntax for the command is:
alter table [[table_name]] enable constraint [[constraint_name]] exceptions into [[exceptions_table_name]]

The example should have used a better, more explanatory table name like 'exceptions_table';

Good luck,
-Jay
Previous Topic: how to get the value of count(*) in plsql
Next Topic: Select Into - Nulls
Goto Forum:
  


Current Time: Thu Mar 28 17:59:32 CDT 2024