It a Feature of Oracle 10g R2.
The CREATE_ERROR_LOG procedure of DBMS_ERRLOG package makes you enables to create an error logging table so that
DML operations can continue after encountering errors rather than abort and roll back.
CREATE TABLE students
(
stud_id NUMBER ,
f_name VARCHAR2(30),
l_name VARCHAR2(30),
salary NUMBER(8) ,
department_id NUMBER CHECK(department_id IN(10,20,30))
);
BEGIN
dbms_errlog.create_error_log('students');
END;
/
SELECT * FROM user_tables ut
WHERE ut.table_name LIKE '%STU%';
DESCRIBE ERR$_STUDENTS;
-------------------------------------------------------
NAME TYPE NULLABLE
-------------------------------------------------------
ORA_ERR_NUMBER$ NUMBER Y
ORA_ERR_MESG$ VARCHAR2(2000) Y
ORA_ERR_ROWID$ UROWID(4000) Y
ORA_ERR_OPTYP$ VARCHAR2(2) Y
ORA_ERR_TAG$ VARCHAR2(2000) Y
STUD_ID VARCHAR2(4000) Y
F_NAME VARCHAR2(4000) Y
L_NAME VARCHAR2(4000) Y
SALARY VARCHAR2(4000) Y
DEPARTMENT_ID VARCHAR2(4000) Y
-------------------------------------------------------
CREATE TABLE old_students
AS SELECT * FROM students;
BEGIN
INSERT INTO old_students VALUES (100,'Fname1','lname1',20000,10);
INSERT INTO old_students VALUES (101,'Fname1','lname1',20000,50);
INSERT INTO old_students VALUES (102,'Fname1','lname1',20000,20);
INSERT INTO old_students VALUES (103,'Fname1','lname1',20000,40);
INSERT INTO old_students VALUES (104,'Fname1','lname1',20000,30);
Commit;
END;
/
SELECT * FROM old_students;
INSERT bstudents
SELECT * FROM old_students
LOG ERRORS INTO ERR$_STUDENTS REJECT LIMIT UNLIMITED;
3 row(S) inserted in 0.078 seconds.
SELECT * FROM ERR$_STUDENTS;
your blog is helping in my studies thank you sql and pl sql Online course
ReplyDelete