When the update statement will check the constraint violation ?

Hello 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.

1)created a function as below.
CREATE OR REPLACE Function otis_mask(incol varchar2) return varchar2 is
random_str varchar2(20);
begin
select (translate(incol,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890','qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0842319576')) INTO random_str FROM DUAL;
return random_str;
end;
2. create a table ssn_mask.
create table ssn_mask(ssn number(10) primary key);
3) inserted 3 rows as below.
insert into ssn_mask values(9949577766);
insert into ssn_mask values(7727399911);
insert into ssn_mask values(9989477700);
4)UPDATE SSN_MASK SET SSN=otis_mask(SSN);
5) Table contains below rows.
Sql >select *from SSN_MASK;
SSN
9949577766
7727399911
9989477700.
6)UPDATE SSN_MASK SET SSN=otis_mask(SSN);
If the above statement process first row 9949577766,then otis_mask function will return 7727399911 and update statement will update the value of 9949577766 to 7727399911 .At this case 7727399911 is already in the table.So update statement should have to throw primary key constraint violation error.
If the above statement process second row 7727399911 first ,then otis_mask function will return 9989477700.and update statement will update the value of 7727399911 to 9989477700.At this case 9989477700 is already in the table.So update statement should have to throw primary key constraint violation error.
But its not throwing any integrity constraint violation error.
i just want to know when update statement will check the constraint ?
is update statement will first process all records and kepp in handy the new values then update the table with new values (or) process the first row and update the new value with old value then process second row and update with new value so on ?
Thanks,
Venkat Vadlamudi.

Similar Messages

  • When I update itunes it deletes the library file, and when I restore that file from the previous libraries or my backup, itunes will run but tell me "the iTunes library file cannot be saved. A folder was specified instead of a file" How do I fix this?

    When I update itunes it deletes the library file, and when I restore that file from the previous libraries or my backup, itunes will run but tell me "the iTunes library file cannot be saved. A folder was specified instead of a file" How do I fix this?

    Hi there Br0x,
    You may want to try rebuilding the iTunes library as an initial troubleshooting step. Take a look at the article below for more information.
    iTunes: How to re-create your iTunes library and playlists
    http://support.apple.com/kb/ht1451
    -Griff W.

  • HT4623 does my emails will be gone when i update my iphone4 on the computer?

    does my emails will be gone when i update my iphone4 on the computer? Because it says that when  i update my phone all of my apps will be deleted but its fine with me all i want to know if my emails and inbox will be lost cause i dont know some of my email passwords !! So Pleas HELP !!! Thanks

    Standard computer operating procedure: You NEVER update software unless ALL of your data is backed up & fully accessible. The iPhone is in essence a mini computer. Things can & do go wrong, even when they're not supposed to. So, if you don't know every password for every email account you have, you need to determine this info BEFORE you do anything.
    It's your choice, but don't complain if things go wrong & you're left with your thumb up you know what.

  • I have an I Pod Nano and would get messages to update my software.   In my I Tunes I have 1,900 songs but after the updates it will only sync 933 songs.  My current software version is 1.0.2.  What am I doing wrong or is it something in the software.  I h

    I have an I Pod Nano and would get messages to update my software.  In my I Tunes I have 1,900 songs but after the updates it will only sync 933 songs.  My current software version is 1.0.2.  What am I doing wrong or is it something in the software.  I have not done anything different in my I Tunes and all songs are checked.  Could someone please help or advise me what to do?

    Thank you Gail, but not to be ignorant but can I send you a print screen on what I am looking at.  I will try am explain what I see: I hooked up my I Pod Clicked on Music checked Sync Music 1909 Songs select Playlist, Artists, albums, and genres checked Include music videos Playlists checked 50's Music checked 70's Music checked 80's Music checked 90's Music checked 2000 Music checked 2010 Music   These are songs that I downloaded onto my I Tunes.  I bought me a new computer but when my data was transferred from old computer to new computer a lot of my songs on my hard drive were lost, but they were able to save all my songs on I tunes.  My I Pod is still connected Clicked on "On this Ipod" Music 938  Songs 2.2 days So my question to you is if I have 1,909 songs on my ITunes how come only 938 transferred to my IPod.  I checked my IPod and it shows only 938 songs transferred.  This did not happen before until I Tunes asked me if I wanted to update to a newer version.  Last month I did have all my 1,909 songs on my I Pod.  I hope this explains what I am asking

  • When I try to download the windows support software it is coming up with an error message saying I am not connected to the internet but having checked the network diagnostics several times I am definitely connected but it still won't work. Any ideas?

    When I try to download the windows support software it is coming up with an error message saying I am not connected to the internet but having checked the network diagnostics several times I am definitely connected but it still won't work. Any ideas?

    I get a problem like yours. I have a mac mini with 2 hdds the server and hd2 I installed windows 7 and the windows works fine. except it will not allow me to get on the net.  I get error 651.  I can boot back to lion and the internet connection works. I googled and error 651 does seem to show up.  I would like  a work around.

  • TS1702 Thanks. I had 6 Apps that needed updating on my iPad original.  I hit "Update All" and that ruined four Apps.  They won't download the updates, nor will they launch and be useable either.  I lost Splashtop 2, Bible!, and Mercury Browser!  Suggestio

    Am I the only fool who clicked on update all when my iPad told me updates were available?  Two updates loaded just fine, but the other four never updated and now lie useless and grayed out. I had 6 Apps that needed updating on my iPad original.  I hit "Update All" and that ruined four Apps.  They won't download the updates, nor will they launch and be useable either.  I lost Splashtop 2, Bible!, and Mercury Browser!  Suggestions?!  I don't want to ruin my access to Splashtop 2 for sure.

    I fixed it by going through a few steps using iTunes while hooked to my computer.

  • What lock does the Update Statement use?

    Hi All,
    Does the below statement will put a row level lock or exclusive lock.
    update employee set emp_name='Emp1' where emp_id=1;
    Regards
    W

    UKJA@ukja102> drop table t1 purge;
    Table dropped.
    Elapsed: 00:00:00.93
    UKJA@ukja102> create table t1(c1 int);
    Table created.
    Elapsed: 00:00:00.09
    UKJA@ukja102>
    UKJA@ukja102> insert into t1 values(1);
    1 row created.
    Elapsed: 00:00:00.00
    UKJA@ukja102> commit;
    Commit complete.
    Elapsed: 00:00:00.03
    UKJA@ukja102>
    UKJA@ukja102> update t1 set c1 = 2;
    1 row updated.
    Elapsed: 00:00:00.00
    UKJA@ukja102>
    UKJA@ukja102> set serveroutput on
    UKJA@ukja102>
    UKJA@ukja102> col sid new_value my_sid
    UKJA@ukja102>
    UKJA@ukja102> select sid
      2  from v$mystat where rownum = 1
      3  ;
           SID                                                                                                                                                                                             
           139                                                                                                                                                                                             
    Elapsed: 00:00:00.03
    UKJA@ukja102>
    UKJA@ukja102> exec print_table('select * from v$lock where sid = &my_sid');
    ADDR                          : 695C4224                                                                                                                                                               
    KADDR                         : 695C423C                                                                                                                                                               
    SID                           : 139                                                                                                                                                                    
    TYPE                          : TM                                                                                                                                                                     
    ID1                           : 74212                                                                                                                                                                  
    ID2                           : 0                                                                                                                                                                      
    LMODE                         : 3                                                                                                                                                                      
    REQUEST                       : 0                                                                                                                                                                      
    CTIME                         : 0                                                                                                                                                                      
    BLOCK                         : 0                                                                                                                                                                      
    ADDR                          : 69612444                                                                                                                                                               
    KADDR                         : 69612560                                                                                                                                                               
    SID                           : 139                                                                                                                                                                    
    TYPE                          : TX                                                                                                                                                                     
    ID1                           : 458787                                                                                                                                                                 
    ID2                           : 13053                                                                                                                                                                  
    LMODE                         : 6                                                                                                                                                                      
    REQUEST                       : 0                                                                                                                                                                      
    CTIME                         : 0                                                                                                                                                                      
    BLOCK                         : 0                                                                                                                                                                      
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.14DML acquires TX lock in exclusive(6) mode(row level lock) and TM lock in row exclusive(3) mode.
    =======================================
    Oracle Performance Storyteller
    Dion Cho
    http://ukja.tistory.com
    http://wiki.ex-em.com/index.php/performance_in_depth
    http://wiki.ex-em.com/index.php/optimizing_oracle_optimizer
    =======================================

  • When the new version will correct the error 10.0.0? program constantly hangs. will not start!

    when the new version will correct the error 10.0.0? program constantly hangs. will not start!

    Are you using any VST plug-ins or audio units? Then check, if they are still compatible. You may need to uninstall them.
    See this support document: 
    Unexpected behavior with Audio Unit plug-ins http://support.apple.com/kb/TS5249

  • We are upgrading EHP4,What are the scenarios we will check in ECC and APO

    Hi gurus,
    We are upgrading (ECC )EHP4
    What are the scenarios we will check in ECC and APO, kindly tell me gurus.
    Regards
    babu

    Babu,
    We live within a dream. The आत्मन् is real, all else is Illusion. Names are illusion.  If DB49 does not suit you, then call me nameless.
    Before you even release the software into the test environment, you must perform unit testing.  Can every transaction that is used by your company be executed?  Does every userexit/enhancement still perform the same task?  Does every custom report work the same? All interfaces passing the proper data?
    Merely testing the software itself will not give your company any assurance that it will support your business after you go live with it, so after unit testing comes integration testing and user acceptance testing.  You must interview Key business users, and from their input you must develop and execute tests for 'business processes'.  For example, one common business scenario (which contains many business processes), Order to Cash:  Check whether your upgraded systems supports your ability to receive and enter an order, plan the parts, obtain the RM, build the parts ship the order, and book the cash.  Or, another Scenario, Procure to Pay:  Check if you can plan RM parts, create/release PR, create PO, send PO to Vendor, receive PO in stock, pay invoice, close month for accounting purposes.
    These are two major business scenarios in most companies that use ERP.  There are hundreds more that can be tested, If you work for a company that cannot afford to have any disruption in their business, then all activities that are normally done by any business user should be tested.
    On the SCM side, during an ERP update, you have a smaller task (SAP usually does a good job with backward compatibility with their own modules).  BW extractors must be tested.  All integration models must be tested.  All userexits must be tested.  Publishing results/releasing results to ERP must be tested. The list goes on and on depending upon which SCM modules you have implemented.
    Regards,
    DB49

  • Thunderbird sometimes changes the height of the letter at will in the middle of a sentence when I'm writing an e-mail.

    Thunderbird sometimes changes the height of the letter at will in the middle of a sentence when I'm writing an e-mail. How can I fix this?

    kaeandcolesmon,
    If you open the recovery drive (partition) it should only have a single folder (Recovery).
    To make sure that your not saving restore points to that drive.
    See:
    Start, Control Panel, System, System Protection tab. Make sure the D drive partition is set to OFF so that it does not save there.
    I am a volunteer. I am not an HP employee.
    To say THANK YOU, press the "thumbs up symbol" to render a KUDO. Please click Accept as Solution, if your problem is solved. You can render both Solution and KUDO.
    The Law of Effect states that positive reinforcement increases the probability of a behavior being repeated. (B.F.Skinner). You toss me KUDO and/or Solution, and I perform better.
    (2) HP DV7t i7 3160QM 2.3Ghz 8GB
    HP m9200t E8400,Win7 Pro 32 bit. 4GB RAM, ASUS 550Ti 2GB, Rosewill 630W. 1T HD SATA 3Gb/s
    Custom Asus P8P67, I7-2600k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX660 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Custom Asus P8Z77, I7-3770k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX670 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Both Customs use Rosewill Blackhawk case.
    Printer -- HP OfficeJet Pro 8600 Plus

  • TS3899 I cannot select an email to delete on my IPhone 5. When I hit edit then check the email i wish to delete it unchecked itself. Help it is driving me crazy. I tried deleting the email account and re-adding it but it didn't work.

    I cannot select an email to delete on my IPhone 5. When I hit edit then check the email i wish to delete it unchecked itself. Help it is driving me crazy. I tried deleting the email account and re-adding it but it didn't work.

    Sorry if I confused you. Let me try again:
    1) do a full backup your iPhone to a PC using iTunes
    2) go to: settings, general, reset, erase all content and settings.erase phone.
    3) when iPhone starts again choose set as new phone. Do not restore from icloud or iTunes.
    4) once done. Setup your email accounts. When done, verify checked emails do not uncheck themselves.
    That resolved, finish setting up:
    5) go to: settings, icloud, uncheck email, and set other icons as wished. Now setup icloud account.
    6)This step will make all contracts reside in icloud and be available always:  Once icloud account is setup, go back to settings, email contacts. Open each email account and uncheck contacts, but leave mail checked. Then go to the icloud email account and check contacts.

  • Just got an iPad 2 and neither Keynote nor Pages were compatible. when I updated iOS as requisited, the backup from iTunes didn't work. the iPad doesn't connect to iTunes. what do I do?

    just got an iPad 2 and neither Keynote nor Pages were compatible. when I updated iOS as requisited, the backup from iTunes didn't work. the iPad doesn't connect to iTunes. what do I do?

    Usually it's because you are not making internet connection via wifi.
    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    Additional things to try.
    Try this first. Turn Off your iPad. Then turn Off (disconnect power cord) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    Change the channel on your wireless router. Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
     Cheers, Tom

  • SQL error msg - The DELETE statement conflicted with the SAME TABLE REFERENCE constraint

    Executed as user: ****. The DELETE statement
    conflicted with the SAME TABLE REFERENCE constraint "FK_PARENT_TASK_REF".
    The conflict occurred in database "****", table "****", column
    'PARENT_TASK_ID'. [SQLSTATE 23000] (Error 547) The statement has been
    terminated. [SQLSTATE 01000] (Error 3621). The step failed.
    Does this error msg indicate the whole script failed to execute or was it just a single step/task that failed ?
    What does error msg mean ?
    Anyway to prevent this error msg and ensure script runs successfully

    Hi mdavidh,
    This error occurs because the record  'PARENT_TASK_ID' was referenced by 'FK_PARENT_TASK_REF'.
    Please refer below codes:
    CREATE TABLE MyTable (
    ID INT, primary key(ID), -- primary key
    ID_Parent INT foreign key(ID_Parent) references MyTable(ID), -- foreign key reference the same table
    insert into MyTable(ID,ID_Parent)
    values(0,0);
    insert into MyTable(ID,ID_Parent)
    values(1,0);
    insert into MyTable(ID,ID_Parent)
    values(2,0);
    insert into MyTable(ID,ID_Parent)
    values(3,1);
    insert into MyTable(ID,ID_Parent)
    values(4,3);
    insert into MyTable(ID,ID_Parent)
    values(5,4);
    CREATE TRIGGER MyTrigger
    on MyTable
    instead of delete
    as
    set nocount on
    update MyTable set ID_Parent = null where ID_Parent in (select ID from deleted)
    delete from MyTable where ID in (select ID from deleted)
    Now we could delete records.
    delete from MyTable where ID_Parent=0
    Thanks,
    Candy Zhou

  • Has anyone experienced problems with Mackeeper? I did not complete downloading this software. Yet, occasionally when on the internet, I will have the MacKeeper multi-colored circle replace my pointer. How do you deal with this?

    Has anyone experienced problems with Mackeeper? I did not complete downloading this software. Yet, occasionally when on the internet, I will have the MacKeeper multi-colored circle replace my pointer. How do you deal with this?

    Welcome to Apple Support Communities
    Don't download MacKeeper. Users complain about this app and it damages OS X. Also, Mac OS X knows how to take care of itself, so you don't need any other cleaning application that may damage OS X. See > https://discussions.apple.com/docs/DOC-3691

  • How will check the space taken by a single table in a tablespace ?

    How will check the space taken by a single table in a tablespace ?
    dba_segments is giving the same values even if I truncate the table?
    Pls reply

    I need to know how can we find out the size of the table in the tablespace.use user_segments (bytes) column.
    How much bytes it has taken ?value from user_segments, bytes column
    If u delete records will the space be used for another table in same tablespace?No, it keep the space in the same table for future usage.
    How can we free that space ?truncate or drop the table and reduce the size from tablespace, if you want to reclaim the space from the tablespace, OS level.
    Jaffar

Maybe you are looking for