when the update statement will check the constraint violation ?
871594Oct 2 2012 — edited Oct 2 2012Hello all,
i am working on data masking of production data using oracle Translate function.i have created a function otis_mask using translate function to mask sensitive values .For this i am tesitng on a small table. i have created a table with single primary key column SSN.
sql>desc SSN_MASK
Name Null? Type
--------------------------------------------------------- -------- -----------------------------------------------
SSN NOT NULL NUMBER(10)
1) i have inserted the value 9949577766. if resulted mask value exist in table it should throw the constraint violation error.But it is not throwing any error.rows are properly updating .
Eg:-
Table contains below values.
PA_DATA_SUB @qdsrih30 >select *from SSN_MASK;
SSN
----------------
7727399911
9949577766
9989477700
UPDATE SSN_MASK SET SSN=otis_mask(SSN);
if above update statement process 7727399911 first then resulted mask value is 9989477700.This value is already in the table.
if the update statement process 9949577766 first then resulted mask value is 7727399911.This value is already in the table.
in any of the above scenario update statement should have to throw constraint violation error. But its not happening. rows are properly updating . when the update statement checking the constraint violation ? after processing all the rows or processing of each row ?
Please help me in understandding the update statement processing ?
Thanks,
Venkat Vadlamudi.