Skip ora-00001 and continue?

Hi,
I need to perform an update on a table like this:
update myTable
set myColumn = ltrim(myColumn, '0'); --trim all leading zeros
I wnat this to perform on every row where it does not conflict with my unique constraint. I do not want to disable the constrataint because then I will end up with dupplicate records.
Is it possible to create a script where the query executes on all rows where it does not conflict with any constrain? ...and simpy skip the confliction-rows?
Thanks!
(Oracle 10g)

how shall i wite the query if I want to take the myOtherColumn into consideration? Following version should capture all possibilities (also when the trimmed pk is already there):
SQL>  create table mytable (mycolumn, myothercolumn, mysecondothercolumn)
as
-- select '1', 'x' , 'y' from dual union all
select '01', 'x' , 'y' from dual union all
select '001', 'x', 'y2' from dual
Table created.
SQL>  alter table mytable add constraint mytable_pk primary key (mycolumn, myothercolumn)
Table altered.
SQL>  select * from mytable
MYC M MY
01  x y
001 x y2
2 rows selected.
SQL>  update mytable t1
   set mycolumn = ltrim (mycolumn, '0')
where rowid in (select max (rowid)
                   from mytable t2
                   group by ltrim (mycolumn, '0'),myothercolumn
                 having count (ltrim (mycolumn, '0')) > 1)
    and not exists (select null from mytable t2 where t2.mycolumn = ltrim(t1.mycolumn,0) and t1.myothercolumn=t2.myothercolumn)
1 row updated.
SQL>  select * from mytable
MYC M MY
01  x y
1   x y2
2 rows selected.

Similar Messages

  • ORA-00001 and ORA-06512 error on  DBMS_WM.ResolveConflicts

    We are getting unique constraint error in Production Database. We are able to merge most of the workspaces with no issues. One workspace is givign errors on merge.
    Here is the code
    begin
    dbms_wm.gotoworkspace('denialletterspoc_onmzpulp');
    dbms_wm.setdiffversions('denialletterspoc_onmzpulp','LIVE');
    dbms_wm.SetConflictWorkspace('denialletterspoc_onmzpulp');
    commit;
    DBMS_WM.BeginResolve('denialletterspoc_onmzpulp');
    DBMS_WM.ResolveConflicts(
    workspace => 'denialletterspoc_onmzpulp',
    table_name => 'MCM_MESSAGE',
    where_clause => ' id in (8403026,10134822,8259485,8259488,8426289,8426287,10186643,8426288) ',
    keep => 'CHILD'
    exception when others then
    DBMS_WM.RollbackResolve('denialletterspoc_onmzpulp');
    raise;
    end;
    ORA-00001: unique constraint (T2.MCM_MESSAGE_PK) violated
    ORA-06512: at line 16
    I looked at the date in XXX_lt tables and it does not look suspecious. Please help us understand
    ORA-00001 and ORA-06512 error.
    Amit Gangwar

    Hi, Ben
    Our OWM_VERSION is 10.2.0.4.3.
    I tried disable and enable constraint MCM_MESSAGE_PK. But didn't fix our issue.
    Split where clause from " id in (...) " syntax to " id = ... " syntax will reduce performance heavily. And I did some test that " id in (...) " syntax works well in our dev env.
    I opened our trace file and get below plsql block. When I perform it get same error with our original codes. Please notice the part of "forall wm_indx in WM_rowids.first .. WM_rowids.last execute immediate 'begin insert into T2.MCM_MESSAGE_lt ... ...", error occurred here. But if I change the "forall" syntax to normal " for ... loop" syntax then no error here. Can you give me some advice or suggestion?
    DECLARE
    WM_rowids wmsys.lt_ctx_pkg.rowidTabType;
    WM_rowids_vt wmsys.lt_ctx_pkg.rowidTabType;
    WM_curver wmsys.lt_ctx_pkg.int_tab;
    WM_vtRow wmsys.lt_ctx_pkg.int_tab;
    WM_nextver wmsys.lt_ctx_pkg.nextver_tab;
    WM_found integer := 0;
    BEGIN
    dbms_wm.gotoworkspace('denialletterspoc_onmzpulp');
    dbms_wm.setdiffversions('denialletterspoc_onmzpulp','LIVE');
    dbms_wm.SetConflictWorkspace('denialletterspoc_onmzpulp');
    /* update the auxilliary table of snapshots */
    /* These are rows in the current version that have already been resolved once */
    update T2.MCM_MESSAGE_aux st
    set (snapShotChild, snapShotParent, versionParent) =
    (select p.WM_childds, p.WM_parentds, p.WM_parentver
    from T2.MCM_MESSAGE_pkc p
    where p.ID = st.ID),
    value = '0',
    wm_opcode = 'CC'
    where st.versionChild = 614
    and (ID) in (select ID
    from T2.MCM_MESSAGE_pkc p
    where (id in (8403026,
    10134822,
    8259485,
    8259488,
    8426289,
    8426287,
    10186643,
    8426288)));
    select distinct WM_ridchild bulk collect
    into WM_rowids
    from T2.MCM_MESSAGE_pkc
    where (id in (8403026,
    10134822,
    8259485,
    8259488,
    8426289,
    8426287,
    10186643,
    8426288))
    and WM_childver != 614;
    if (WM_rowids.first is not null) then
    WM_found := 1;
    forall wm_indx in WM_rowids.first .. WM_rowids.last
    update T2.MCM_MESSAGE_lt
    set retireTime = wmsys.owm_9ip_pkg.activeTimeForDML,
    nextver = wmsys.lt_ctx_pkg.getNextVer(nextver,
    614,
    version,
    'denialletterspoc_onmzpulp',
    'CRS_LEAF',
    22)
    where rowid = WM_rowids(wm_indx)
    returning wmsys.lt_ctx_pkg.getCurNextVer bulk collect into WM_nextver;
    /* These are the rows that have not yet been resolved after the latest BeginResolve */
    forall wm_indx in WM_rowids.first .. WM_rowids.last execute immediate
    'begin insert into T2.MCM_MESSAGE_lt(ID,DPS_APPLICATION_ID,TYPE_ID,NAME,PRIVILEGED,CAMPAIGN_ID,TEXT,FILE_NAME,GRAPHIC_WIDTH,GRAPHIC_HEIGHT,DESCRIPTION,ACTIVE,INCLUDE_IN_LIBRARY,MESSAGE_FILTER_ID,OP_USER_ID,OP_WORKSPACE,OP_TIME,version,createtime,retiretime,nextver,delstatus,ltlock)
    (select t1.ID,t1.DPS_APPLICATION_ID,t1.TYPE_ID,t1.NAME,t1.PRIVILEGED,t1.CAMPAIGN_ID,t1.TEXT,t1.FILE_NAME,t1.GRAPHIC_WIDTH,t1.GRAPHIC_HEIGHT,t1.DESCRIPTION,t1.ACTIVE,t1.INCLUDE_IN_LIBRARY,t1.MESSAGE_FILTER_ID,t1.OP_USER_ID,t1.OP_WORKSPACE,t1.OP_TIME,614, wmsys.owm_9ip_pkg.activeTimeForDML, null,:1, sign(delstatus)*(abs(delstatus)+1),
    wmsys.lt_ctx_pkg.checkngetlock(''C'', t1.ltlock, t1.nextver, ''denialletterspoc_onmzpulp'', 0,
    ''MODIFY'', t1.version, t1.delstatus, 0, 1)
    from T2.MCM_MESSAGE_lt t1
    where t1.rowid = :2); end;'
    using WM_nextver(wm_indx),
    WM_rowids(wm_indx)
    end if;
    if (WM_found = 1) then
    wmsys.lt_ctx_pkg.update_modified_tables('T2',
    'MCM_MESSAGE',
    614,
    'denialletterspoc_onmzpulp',
    22);
    end if;
    if (WM_found = 1) then
    forall wm_indx in WM_rowids.first .. WM_rowids.last
    delete from T2.MCM_MESSAGE_aux
    where (ID) in (select ID
    from T2.MCM_MESSAGE_lt
    where rowid = WM_rowids(wm_indx))
    and childState = 'denialletterspoc_onmzpulp';
    end if;
    /* now insert new syncing information about these rows */
    execute immediate 'insert into T2.MCM_MESSAGE_aux (
    select ID,
    p.WM_childstate, p.WM_parentstate,
    p.WM_childds, 614, p.WM_parentds, p.WM_parentver, ''0'',''CC''
    from T2.MCM_MESSAGE_pkc p
    where ( id in (8403026,10134822,8259485,8259488,8426289,8426287,10186643,8426288) ) )';
    END;
    Thanks
    Amos

  • Rerunning script (DML and DDL) without ora-00001 and ora-00955 errors

    What is the best way to write a DML and DDL script so that it can be run multiple times without these ORA errors:
    ORA-00955: name is already used by an existing object
    ORA-00001: unique constraint (JILL.SYS_C00160247) violated
    I have just joined a product development company using SQL Server as there primary database. They have just completed a port to Oracle.
    Their product release upgrades (given to clients) include sql scripts with database changes (structure and data). They require that the client be able to rerun the scripts more than once with no errors. In SQL Server, the accomplish it this way.
    For DDL:
    if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[MyTab]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    Begin
         CREATE TABLE [dbo].[MyTab] (
              [ID]int IDENTITY(1,1),
              [InvID] uniqueidentifier not null
    For DML:
    IF NOT EXISTS (SELECT 1 FROM [dbo].[mytab] WHERE [Name] = 'Smith' and [ID] = 3)
    BEGIN
    INSERT INTO [dbo].[mytab]
    ([ID] ,[Name]
    VALUES (3,'Smith')
    END
    I am tasked with duplicating this logic on the Oracle side. The only way I can think of so far is using plsql and checking for existence before every insert and create statement. The other options I thought of cannot be used in this case
    - "whenever sqlerror continue" - gives the same response for all errors. True errors should stop the code, so this is too risky.
    - "log errors into ... reject limit unlimited" on the insert - I thought this was my best solution until I found out that it doesn't support lobs.
    Do you know of any more elegant (and more efficient) solution other than plsql cursors to check for existence before running each insert/create?
    Any suggestions would be greatly appreciated.

    select table_name from user_tables will give you the table exist or not.
    all_tables/dba_tables
    http://download.oracle.com/docs/cd/B14117_01/server.101/b10755/statviews_1190.htm#i1592091

  • Copying files - how to skip bad files and continuing to copy?

    I recovered some files off a dieing HDD (approximately 600GB worth). These are sitting on a good condition and fully functioning external HDD. I am trying to copy these files from this external HDD to another external HDD. It appears that some of the files that were recovered are actually corrupt as when copying and pasting, it gets to around the 120GB mark before I received the following error:
    "The Finder can't complete the operation becauise some data in [files name] can't be read or written.
    (Error code -36)"
    When attemping the Ditto command in terminal, at the same point, I get the following error in Terminal:
    "Volume/[drive name]/[folder name]/[file name]: Input/output error"
    Due to the number of files (in the 100's of thousands I believe) I do not want to start trying to copy and paste individual files and folders.
    Does anyone know of a program that will skip the bad files and continue to copy? Microsoft Windows does this natively, but as my HDD are in Mac OS X format, that doesn't help. Surely there is some App or program that can perform this function?

    I recovered some files off a dieing HDD (approximately 600GB worth). These are sitting on a good condition and fully functioning external HDD. I am trying to copy these files from this external HDD to another external HDD. It appears that some of the files that were recovered are actually corrupt as when copying and pasting, it gets to around the 120GB mark before I received the following error:
    "The Finder can't complete the operation becauise some data in [files name] can't be read or written.
    (Error code -36)"
    When attemping the Ditto command in terminal, at the same point, I get the following error in Terminal:
    "Volume/[drive name]/[folder name]/[file name]: Input/output error"
    Due to the number of files (in the 100's of thousands I believe) I do not want to start trying to copy and paste individual files and folders.
    Does anyone know of a program that will skip the bad files and continue to copy? Microsoft Windows does this natively, but as my HDD are in Mac OS X format, that doesn't help. Surely there is some App or program that can perform this function?

  • Ora-00001 and triggers

    I have a trigger that fires after tbl 1 col 9 update event.
    the trigger references old as old new as new on tbl 1.
    and proceeds to test old.value vs new.value
    it's goal is to insert a row into tbl 2 which are values from tbl 1.
    tbl 2 contains a unique constraint.
    I am trying to trap the condition DUP_VAL_ON_INDEX within the trigger and "log" the key thats failing, but continue. In this case the trigger is a hidden procedure from a called procedure whos goal is to update tbl 1 col 9 with a date.
    I have tryed this a number of ways.
    any help would be appreciated.
    tbl2 PK is a 6 part combo (julian_yr,julian_day,submit_typ,btch_num,id_num,adj_num)
    CREATE OR REPLACE TRIGGER tbl2
    AFTER UPDATE
    ON tbl1
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    begin
    if (:old.h_upld_dt is null and
    :new.h_upld_dt is not null) then
    if (:new.status_cd in ('EOK', 'MIS', 'DUP')) then
    insert into tbl2
    values (:new.julian_yr,
    :new.julian_day,
    :new.submit_typ,
    :new.btch_num,
    :new.id_num,
    :new.adj_num,
    sysdate, '', '', '');
    end if;
    end if;
    EXCEPTION
    WHEN DUP_VAL_ON_INDEX THEN
    DBMS_OUTPUT.PUT_LINE ('tbl1 trigger into tbl2 failure: ' ||
    :new.julian_day ||
    :new.submit_typ ||
    :new.btch_num ||
    :new.id_num ||
    :new.adj_num ||
    sysdate);
    null;
    end;
    /

    there is always differnet ways to reach the goal.
    I was able to return the exception dup_val_on_index from the trigger back to the initiating procedure then deal with the issue there, which seems to work well. More testing should confirm.
    Thanks

  • "Can't open file; skipping it and continuing" Part2

    I am also having a problem with iMovie 3 not being able to import my dv clip. The clip in it's entirety is about 15 minutes long, way past the 9 minute minimum. When I open the move project containing that clip it only imports the first 1.5 minutes, when I import it I get and error of -40, and knowing that it plays the entire 15+ minutes as qt movie I try to drag the clip into the time frame and get "Can't open file; skipping it and continuing". The clip works fine in iMovie HD at my computer at work. Can I try to splice the clip into smaller clips and exporting to use it at home?

    http://www.danslagle.com/mac/iMovie/tips_tricks/6003.shtml

  • OWB mappings to skip rows that are in error and continue processing

    OWB mappings to skip rows that are in error and continue processing.
    1) Enter a record into an error log
    2) Skip rows that are in error
    3) and continue processing
    Type of information could be needed in the error log:
    SY_LOG_ERROR_KEY
    ERROR_TIMESTAMP
    MAP_NAME
    SOURCE_RECORD
    ERROR_CODE
    ERROR_MESSAGE
    ERROR_NOTES
    Example:
    If the source table has five records, in that 3 records has some error.
    When I run the OWB mapping to load the source data to target table, OWB should skip the 3 record and load all the remaining record. This is our requirement.
    Another think I want to store the error record details in a error log table.
    Can u plz tell me whether it is possible in OWB. If not means please give some suggestion to do this.

    Hi,
    thanks for ur help, As is OWB version is 10.2.0 so for set based it is not working. with your idea i create a POST PROCESSING MAPPING. it is now working fine.
    Step 1:
    Create a table MAP_ERROR_LOG.
    Script:
    CREATE TABLE MAP_ERROR_LOG
    ERROR_SEQ NUMBER,
    MAPPING_NAME VARCHAR2(32 BYTE),
    TARGET_TABLE VARCHAR2(35 BYTE),
    TARGET_COLUMN VARCHAR2(35 BYTE),
    TARGET_VALUE VARCHAR2(100 BYTE),
    PRIMARY_TABLE VARCHAR2(100 BYTE),
    ERROR_ROWKEY NUMBER,
    ERROR_CODE VARCHAR2(12 BYTE),
    ERROR_MESSAGE VARCHAR2(2000 BYTE),
    ERROR_TIMESTAMP DATE
    TABLESPACE ODS_D1_AA
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 80K
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOGGING
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;
    Step 2:
    Create a sequence MAP_ERROR_LOG_SEQ
    CREATE SEQUENCE MAP_ERROR_LOG_SEQ START WITH 1 INCREMENT BY 1
    Step 3:
    Create a procedure PROC_MAP_ERROR_LOG through OWB.
    In this i have used 3 cursor, first cursor is used to check the count of error messages for the corresponding table(WB_RT_ERROR_SOURCES).
    The second cursor is used to get the oracle error and the primary key values.
    The third cursor is used for get the ORACLE DBA errors such as "UNABLE TO EXTEND THE TABLESPACE" for this type errors.
    CREATE OR REPLACE PROCEDURE PROC_MAP_ERROR_LOG(MAP_ID VARCHAR2) IS
    --initialize variables here
    CURSOR C1 IS
    SELECT COUNT(RTA_IID) FROM OWBREPO.WB_RT_ERROR_SOURCES
    WHERE RTA_IID =( SELECT MAX(RTA_IID) FROM OWBREPO.WB_RT_AUDIT WHERE RTA_PRIMARY_TARGET ='"'||MAP_ID||'"');
    V_COUNT NUMBER;
    CURSOR C2 IS
    SELECT A.RTE_ROWKEY ERR_ROWKEY,SUBSTR(A.RTE_SQLERRM,1,INSTR(A.RTE_SQLERRM,':')-1) ERROR_CODE,
    SUBSTR(A.RTE_SQLERRM,INSTR(A.RTE_SQLERRM,':')+1) ERROR_MESSAGE,
    C.RTA_LOB_NAME MAPPING_NAME,SUBSTR(B.RTS_SOURCE_COLUMN,(INSTR(B.RTS_SOURCE_COLUMN,'.')+1)) TARGET_COLUMN,
    B.RTS_VALUE TARGET_VALUE,C.RTA_PRIMARY_SOURCE PRIMARY_SOURCE,C.RTA_PRIMARY_TARGET TARGET_TABLE,
    C.RTA_DATE ERROR_TIMESTAMP
    FROM OWBREPO.WB_RT_ERRORS A,OWBREPO.WB_RT_ERROR_SOURCES B, OWBREPO.WB_RT_AUDIT C
    WHERE C.RTA_IID = A.RTA_IID
    AND C.RTA_IID = B.RTA_IID
    AND A.RTA_IID = B.RTA_IID
    AND A.RTE_ROWKEY =B.RTE_ROWKEY
    --AND RTS_SEQ =1  
    AND B.RTS_SEQ IN (SELECT POSITION FROM ALL_CONS_COLUMNS A,ALL_CONSTRAINTS B
    WHERE A.TABLE_NAME = B.TABLE_NAME
    AND A.CONSTRAINT_NAME = B.CONSTRAINT_NAME
    AND A.TABLE_NAME =MAP_ID
    AND CONSTRAINT_TYPE ='P')
    AND A.RTA_IID =(
    SELECT MAX(RTA_IID) FROM OWBREPO.WB_RT_AUDIT WHERE RTA_PRIMARY_TARGET ='"'||MAP_ID||'"');
    CURSOR C3 IS
    SELECT A.RTE_ROWKEY ERR_ROWKEY,SUBSTR(A.RTE_SQLERRM,1,INSTR(A.RTE_SQLERRM,':')-1) ERROR_CODE,
    SUBSTR(A.RTE_SQLERRM,INSTR(A.RTE_SQLERRM,':')+1) ERROR_MESSAGE,
    C.RTA_LOB_NAME MAPPING_NAME,SUBSTR(B.RTS_SOURCE_COLUMN,(INSTR(B.RTS_SOURCE_COLUMN,'.')+1)) TARGET_COLUMN,
    B.RTS_VALUE TARGET_VALUE,C.RTA_PRIMARY_SOURCE PRIMARY_SOURCE,C.RTA_PRIMARY_TARGET TARGET_TABLE,
    C.RTA_DATE ERROR_TIMESTAMP
    FROM OWBREPO.WB_RT_ERRORS A,OWBREPO.WB_RT_ERROR_SOURCES B, OWBREPO.WB_RT_AUDIT C
    WHERE C.RTA_IID = A.RTA_IID
    AND A.RTA_IID = B.RTA_IID (+)
    AND A.RTE_ROWKEY =B.RTE_ROWKEY (+)
    AND A.RTA_IID =(
    SELECT MAX(RTA_IID) FROM OWBREPO.WB_RT_AUDIT WHERE RTA_PRIMARY_TARGET ='"'||MAP_ID||'"');
    -- main body
    BEGIN
    DELETE ED_ODS.MAP_ERROR_LOG WHERE TARGET_TABLE ='"'||MAP_ID||'"';
    COMMIT;
    OPEN C1;
    FETCH C1 INTO V_COUNT;
    IF V_COUNT >0 THEN
    FOR REC IN C2
    LOOP
    INSERT INTO ED_ODS.MAP_ERROR_LOG
    (Error_seq ,
    Mapping_name,
    Target_table,
    Target_column ,
    Target_value ,
    Primary_table ,
    Error_rowkey ,
    Error_code ,
    Error_message ,
    Error_timestamp)
    VALUES(
    ED_ODS.MAP_ERROR_LOG_SEQ.NEXTVAL,
    REC.MAPPING_NAME,
    REC.TARGET_TABLE,
    REC.TARGET_COLUMN,
    REC.TARGET_VALUE,
    REC.PRIMARY_SOURCE,
    REC.ERR_ROWKEY,
    REC.ERROR_CODE,
    REC.ERROR_MESSAGE,
    REC.ERROR_TIMESTAMP);
    END LOOP;
    ELSE
    FOR REC IN C3
    LOOP
    INSERT INTO ED_ODS.MAP_ERROR_LOG
    (Error_seq ,
    Mapping_name,
    Target_table,
    Target_column ,
    Target_value ,
    Primary_table ,
    Error_rowkey ,
    Error_code ,
    Error_message ,
    Error_timestamp)
    VALUES(
    ED_ODS.MAP_ERROR_LOG_SEQ.NEXTVAL,
    REC.MAPPING_NAME,
    REC.TARGET_TABLE,
    REC.TARGET_COLUMN,
    REC.TARGET_VALUE,
    REC.PRIMARY_SOURCE,
    REC.ERR_ROWKEY,
    REC.ERROR_CODE,
    REC.ERROR_MESSAGE,
    REC.ERROR_TIMESTAMP);
    END LOOP;
    END IF;
    CLOSE C1;
    COMMIT;
    -- NULL; -- allow compilation
    EXCEPTION
    WHEN OTHERS THEN
    NULL; -- enter any exception code here
    END;

  • ORA-00001 When I try and create an interactive query/report

    Interactive report in APEX 3.2
    I have a query like this that does a country lookup
    based on the physical address and the mailing address.
    The query executes fine through SQL plus but when I try and create
    an interactive report I get
    ORA-00001: unique constraint (APEX_030200.WWV_FLOW_WORKSHEET_COLUMNS_UK2) violated
    Here's the query
    select     "TAX_VENDORS"."VENDOR_ID" as "VENDOR_ID",
         "TAX_VENDORS"."VENDOR_NAME" as "VENDOR_NAME",
         "TAX_COUNTRY"."ABBREVIATION" as "ABBREVIATION",
         "TAX_COUNTRY_1"."ABBREVIATION" as "ABBREVIATION"
    from     "TAX_COUNTRY" "TAX_COUNTRY_1",
         "TAX_COUNTRY" "TAX_COUNTRY",
         "TAX_VENDORS" "TAX_VENDORS"
    where "TAX_VENDORS"."PHYSICAL_COUNTRY"="TAX_COUNTRY"."TAX_COUNTRY_ID"
    and     "TAX_VENDORS"."MAILING_COUNTRY"="TAX_COUNTRY_1"."TAX_COUNTRY_ID"
    I've narrowed it down to the double lookup if you will of the country for the
    mail/physical address.
    Is this not allowed? Is there a work around?

    Thanks Tony
    A closer look at the constraint reveals this - so maybe it's seeing the TAX_COUNTRY_ID twice I would guess where the alias is not accounted for.
         CONSTRAINT "WWV_FLOW_WORKSHEET_COLUMNS_UK2" UNIQUE ("WORKSHEET_ID", "DB_COLUMN_NAME")
    Your query yielded me the same result
    select TV.VENDOR_ID as VENDOR_ID,
    TV.VENDOR_NAME as VENDOR_NAME,
    TC.ABBREVIATION as ABBREVIATION,
    TC_1.ABBREVIATION as ABBREVIATION
    from TAX_VENDORS TV
    JOIN TAX_COUNTRY TC ON (TV.PHYSICAL_COUNTRY = TC.TAX_COUNTRY_ID)
    JOIN TAX_COUNTRY TC_1 ON (TV.MAILING_COUNTRY=TC_1.TAX_COUNTRY_ID)

  • Script single button to play frames, then skip some, and continue play?

    Just as the topic says, I want to script a button to go to
    and play through a motion tween, but then skip some frames to then
    play another motion tween all in one button press. For example,
    play frame 1 which plays the tween and ends at frame 10 (I have
    that part down fine) but then for it to skip ahead to continue to
    play frame 20 and then of course stop once it finishes that motion
    tween.
    Tried a few searches but its too many words to explain so I
    wasnt finding anything. Its probably a simple command im just not
    familiar with yet. Can anyone help?

    I probably should have been more specific. I cant add
    anything to the timeline because I have multiple buttons using the
    first tween, which is a fade out. Thats why I need a script to add
    to each button only to play through that first common tween, and
    then skip to play an individual tween set for each button. Like
    button 1 goes through the first common tween, a fade out (plays
    frames 41 - 53) and its individual tween is frames 54 - 66. This
    works fine of course because the tweens are next to each other.
    Button 2's individual tween starts on frame 67, so it needs to play
    through the common tween fade (41 - 53) skip Button 1's frames, and
    continue play on 67. These buttons are located on frame 1 (main
    menu) so is it even possible to script a button to do such a thing?
    I figured there would be but nothing im trying or seeing online is
    working. Heh... does this make sense? :o
    The only other way I know it will work is if I copy and paste
    all the information in the layers before each section but that
    causes me to have to push a lot of information further down the
    timeline, kinda making a big mess and causing me to rescript all
    frames there.

  • How to avoid: ORA-01403 no data found AND ORA-00001

    Hi,
    below my code:
    CREATE TABLE TAB_TO_EM
      EM_NUMBER           VARCHAR2(32),
      NAME_FIRST       VARCHAR2(32),
      NAME_LAST        VARCHAR2(32),
      MAILBOX            VARCHAR2(32)
    ALTER TABLE TAB_TO_EM
    ADD (CONSTRAINT PK_EM_NUMBER PRIMARY KEY (EM_NUMBER));
    CREATE TABLE EM
      EM_ID            VARCHAR2(32),
      EM_NUMBER           VARCHAR2(32),
      NAME_FIRST       VARCHAR2(32),
      NAME_LAST        VARCHAR2(32),
      EMAIL            VARCHAR2(32)
    ALTER TABLE EM
    ADD (CONSTRAINT PK_EM_ID PRIMARY KEY (EM_ID));THE PRIMARY KEY EM_ID COMES FROM THE TAB_TO_EM TABLE LINKED IN THIS WAY:
    NAME_LAST||'_'||SUBSTR(NAME_FIRST,1,3)||'_'||SUBSTR(EM_NUMBER,-2)
    I created this procedure to insert a new EM_NUMBER into EM table:
    CREATE OR REPLACE PROCEDURE INS_NEW_RECORD IS
    ERR_NUM                          NUMBER;
    ERR_MSG                          VARCHAR2(300);
    V_COUNT                          NUMBER;
    V_EM_ID                          VARCHAR2(64);
          CURSOR A IS
          SELECT A.EM_NUMBER, A.NAME_FIRST, A.NAME_LAST, A.MAILBOX
          FROM TAB_TO_EM A;
    BEGIN
          FOR CUR_A IN A
      LOOP
                 SELECT COUNT(*)
                 INTO V_COUNT
                 FROM EM2 B
                 WHERE B.EM_NUMBER=CUR_A.EM_NUMBER;
                 IF V_COUNT = 0 THEN
                 -- here insert a new record
                              INSERT INTO EM2 (EM_ID, EM_NUMBER, NAME_FIRST,NAME_LAST, EMAIL)
                              VALUES (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2),
                              CUR_A.EM_NUMBER, CUR_A.NAME_FIRST,CUR_A.NAME_LAST, CUR_A.MAILBOX);
                 END IF;
      END LOOP;
    END INS_NEW_RECORD;Example of my table:
    Insert into TAB_TO_EM
       (EM_NUMBER, NAME_FIRST, NAME_LAST, MAILBOX)
    Values
       ('22333', 'AAAA', 'BBBB', 'XXXX');
    Insert into TAB_TO_EM
       (EM_NUMBER, NAME_FIRST, NAME_LAST, MAILBOX)
    Values
       ('11222', 'AAAA', 'BBBB', 'XXXX');
    Insert into TAB_TO_EM
       (EM_NUMBER, NAME_FIRST, NAME_LAST, MAILBOX)
    Values
       ('00122', 'AAAA', 'BBBB', 'XXXX');
    commit;
    execute INS_NEW_RECORD;
    ORA-00001: ORA-00001: unique constraint violated (PK_EM_ID)
    ORA-06512: a "INS_NEW_RECORD", line 25
    ORA-06512: a line 2I tried to modify my procedure:
    CREATE SEQUENCE AFM.SEQ_EM_ID
      START WITH 1
      MAXVALUE 999999999999999999999999999
      MINVALUE 1
      NOCYCLE
      NOCACHE
      ORDER;
    IF V_COUNT = 0 THEN
           --verify duplicate pkey
                 SELECT (NAME_LAST||'_'||SUBSTR(NAME_FIRST,1,3)||SUBSTR(EM_NUMBER,-2))
                 INTO V_EM_ID
                 FROM EM B
                 WHERE (NAME_LAST||'_'||SUBSTR(NAME_FIRST,1,3)||SUBSTR(EM_NUMBER,-2)) = (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2))
                 AND ROWNUM=1;
                 IF V_EM_ID = (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2)) THEN
                          INSERT INTO EM2 (EM_ID, EM_NUMBER, NAME_FIRST,NAME_LAST, EMAIL)
                          VALUES (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2)||'_'||SUBSTR ('000' || SEQ_EM_ID.NEXTVAL, -3),
                          CUR_A.EM_NUMBER, CUR_A.NAME_FIRST,CUR_A.NAME_LAST, CUR_A.MAILBOX);
                 ELSE
                              INSERT INTO EM2 (EM_ID, EM_NUMBER, NAME_FIRST,NAME_LAST, EMAIL)
                              VALUES (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2),
                              CUR_A.EM_NUMBER, CUR_A.NAME_FIRST,CUR_A.NAME_LAST, CUR_A.MAILBOX);
                 END IF;
          END IF;
    execute INS_NEW_RECORD;
    ORA-01403 no data foundI'd like to create a stored procedure with these conditions:
    IF em_id is duplicate insert new em_id= (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2)||'_'||SUBSTR ('000' || SEQ_EM_ID.NEXTVAL, -3)
    ELSE em_id= (CUR_A.NAME_LAST||'_'||SUBSTR(CUR_A.NAME_FIRST,1,3)||SUBSTR(CUR_A.EM_NUMBER,-2)
    How can I write my procedure correctly?
    Thanks in advance!

    1) What are you expecting this piece of code to do?
                 SELECT COUNT(*)
                 INTO V_COUNT
                 FROM EM B
                 WHERE B.EM_NUMBER=CUR_A.EM_NUMBER;My answer would be that i expect it to do nothing (unless i've misunderstood what you're doing up until now). You are making a new type of key in the EM table by frankensteining data elements from your tab_to_em table, so i would expect that code to always return 0. By the way, that's what we have a dup_val_on_index catch for, no need to read the table, you try your insert, if you dup a value, you take appropriate action.
    I guess the best way to proceed based on what you've provided would be 2 SQL statements.
    1) insert records where you cannot find a match in the target table
    2) insert records where you CAN find a match in the target table
    INSERT INTO EM (EM_ID, EM_NUMBER, NAME_FIRST,NAME_LAST, EMAIL)
    select
      A.NAME_LAST||'_'||SUBSTR(A.NAME_FIRST,1,3)||SUBSTR(A.EM_NUMBER,-2),
      A.EM_NUMBER,
      A.NAME_FIRST,
      A.NAME_LAST,
      A.MAILBOX
    from tab_to_em a
    where not exists
      select null
      from em b
      where b.NAME_LAST||'_'||SUBSTR(b.NAME_FIRST,1,3)||SUBSTR(b.EM_NUMBER,-2) = a.em_number
    INSERT INTO EM (EM_ID, EM_NUMBER, NAME_FIRST,NAME_LAST, EMAIL)
    select
      A..NAME_LAST||'_'||SUBSTR(A..NAME_FIRST,1,3)||SUBSTR(A..EM_NUMBER,-2)'_'||SUBSTR ('000' || SEQ_EM_ID.NEXTVAL, -3),
      A.EM_NUMBER,
      A.NAME_FIRST,
      A.NAME_LAST,
      A.MAILBOX
    from tab_to_em a
    where exists
      select null
      from em b
      where b.NAME_LAST||'_'||SUBSTR(b.NAME_FIRST,1,3)||SUBSTR(b.EM_NUMBER,-2) = a.em_number
    );This comes with the caveat that what you are doing is a REALLY bad idea. Really really really bad idea.
    The baddies are
    1) your choice for a 'primary key'
    2) using a sequence and then substring it
    3) this is from a business perspective, storing the same person multiple times!
    Now, i don't know your system or requirements, but i am speaking in general terms here, this seems like a all around bad idea and i would suggest you revisit the design.

  • Ora-00604 and ora-00001 when deploying mapping

    Hi,
    I have a problem when I want to deploy a mapping. I get the following errors: ora-00604 'error occurred at recursive SQL level 1' and ora-00001 'unique constraint violated (SYS.I_SOURCE1)'.
    I'm using owb 11.1.0.7.0.
    Can anybody help me to solve this?

    user9033344 wrote:
    Hi,
    I have a problem when I want to deploy a mapping. I get the following errors: ora-00604 'error occurred at recursive SQL level 1' and ora-00001 'unique constraint violated (SYS.I_SOURCE1)'.
    I'm using owb 11.1.0.7.0.
    Can anybody help me to solve this?Oracle Support.

  • Ora-06512  and ora-00001

    when our developer tries to insert few records in a table
    it throws error
    ora-00001 & ora-06512,
    when i tried to disable or drop the constraint indicated in the error 0ra-06512
    it throws ora-02431 - constraint not existing
    please guide us to solve this error.
    santhanam.

    I agree with Centinul, you probably do not want to get rid of the uniquenes enforced on the column. Better to find out why the developer is inserting duplicate records and fix that, or, if it is possible that you might get duplicate records in production, then develop a method of handling the error that properly meets your business needs.
    The ORA-00001 error can come from 3 sources. A PK constraint, a unique constraint and a unique index without a formal constraint.
    SQL> create table t (id number);
    Table created.
    SQL> create unique index t_unq on t(1d);
    Index created.
    SQL> insert into t values (1);
    1 row created.
    SQL> insert into t values (1);
    insert into t values (1)
    ERROR at line 1:
    ORA-00001: unique constraint (OPS$ORACLE.T_UNQ) violatedDropping the constraint t_unq is not possible, I would need to drop the index. But I wouldn't, since in the vast majority of cases, the requirement for uniqueness is a business requirement, and not something put in to anoy developers.
    John

  • ** Is it possible to skip messages with error in BPM and continue next msg

    Hi Friends,
    I am doing File to File BPM scenario. My Source XML is like as below.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Employee xmlns:ns0="http://www.test.com/XITEST/FileToFile/BPM">
       <Details>
          <EmpCode>10010</EmpCode>
          <EmpName>Jeg</EmpName>
          <***>M</***>
          <BasicPay>5000</BasicPay>
       </Details>
       <Details>
          <EmpCode>10011</EmpCode>
          <EmpName>Praksh</EmpName>
          <***>M</***>
          <BasicPay>4500</BasicPay>
       </Details>
       <Details>
          <EmpCode>10012</EmpCode>
          <EmpName>Nithya</EmpName>
          <***>F</***>
          <BasicPay>4300</BasicPay>
       </Details>
       <Details>
          <EmpCode>10013</EmpCode>
          <EmpName>Sunil</EmpName>
          <***>F</***>
          <BasicPay>4800</BasicPay>
       </Details>
       <Details>
          <EmpCode>10014</EmpCode>
          <EmpName>Abdul</EmpName>
          <***>M</***>
          <BasicPay>4750</BasicPay>
       </Details>
       <Details>
          <EmpCode>10015</EmpCode>
          <EmpName>Sathya</EmpName>
          <***>F</***>
          <BasicPay>4250</BasicPay>
       </Details>
       <Details>
          <EmpCode>10016</EmpCode>
          <EmpName>Rams</EmpName>
          <***>M</***>
          <BasicPay>8000</BasicPay>
       </Details>
    </ns0:Employee>
    If you look at the above message, the 3rd & 6th employee are female. In the BPM design,  we use
    a) 'Transformation' step, to split the messages (1:n).
    b) Block Step (Mode : For Each) to process one by one message
    c) in the Container Step, thru XPath expression we created one variable and assign '***' to that variable
    d) In the Switch step we check whether variable is 'F' (Female). If it is there we insert control step to throw exception. (But, exception Branch is not added to catch the exception. The reason is that to restart the BPM)
    e) If the *** is 'M' we insert Send Step to send the employee to the output file.
    Note that if we insert exception handler branch, the BPM will tell this is completed. So, we are not able to restart those records (*** = 'F') after correct ***. Once the BPM is completed, that work item will not come in tcode 'Continue Process Following Error' option in tcode SXMB_MONI_BPE
    Requirement is whenever the BPM encounters *** = 'F', it  should throw an error and the same time BPM should not stop and continue with the next records.
    Friends, we tried all the ways thru 'Queue Assignment' property of the BPM and made settings thru tcode SWF_INB_CONF. But, we are not able to achive this requirmenent.
    'Restart possibilitye of the BPM for the error record and the same time should process the remaining correct records'. 
    Any idea friends, to solve this issue.
    Kindly Reply,
    Jeg P.

    Use one more Receiver Abstract interface for this and do the message and interface mapping .
    Collecting :
    If ur record is female (u r checking this in swich step) ,  pass tht record to intreface mapping (use one branch here to collect the message).
    Else you send that message to the target(else branch)
    After that use one block for collecting messages and throw the exception for each record......

  • ORA-00001 - unique constraint violation when upgrading 10g EUL

    Hi,
    I am trying to upgrade my Discoverer 4i to Discoverer 10g.
    When I log into 10g, it prompts me to upgrade the EUL. After making the right back up of my 4i EUL, I continue with the upgrade.
    During the upgrade, I am hit with this error:
    Database error: ORA-00001 unique constraint (EUL_HRMS.EUL5_FOL_UK_1) violated.
    I understand that this happens when user tries to insert an already existing value into a column defined as unique. However, I am not sure on how to resolve it.
    Can anyone please advice.
    Thanks in advance!
    Regards,
    Harpreet Sidhu

    Hi Rod,
    I've run the queries and these are the results. Each query returned one row.
    1. SELECT FROM EUL_HRMS.EUL5_DOC_FOLDERS*
    FOL_ID     100057
    FOL_NAME     ROOT
    FOL_DEVELOPER_KEY     ROOT
    FOL_DESCRIPTION     
    FOL_EU_ID     100000
    FOL_PARENT_ID     
    FOL_USER_PROP2     
    FOL_USER_PROP1     
    FOL_ELEMENT_STATE     0
    FOL_CREATED_BY     EUL_HRMS
    FOL_CREATED_DATE     19-Jun-09
    FOL_UPDATED_BY     EUL_HRMS
    FOL_UPDATED_DATE     19-Jun-09
    NOTM     0
    2. SELECT EU_ID, EU_SECURITY_MODEL, EU_USE_PUB_PRIVS, EU_ROLE_FLAG
    FROM EUL_HRMS.EUL5_EUL_USERS
    WHERE EU_USERNAME = 'PUBLIC'
    EU_ID     3000
    EU_SECURITY_MODEL     0
    EU_USE_PUB_PRIVS     1
    EU_ROLE_FLAG     0
    Thanks!

  • ORA-00001: unique constraint @ impdp with table_exists_action=truncate

    Hi everybody
    I can't understand why my data pump import execution with parameter TABLE_EXISTS_ACTION=TRUNCATE returned ORA-00001 (unique constraint violation), while importing schema tables from a remote database where the source tables have the same unique constraints as the corresponding ones on the target database.
    Now my question is "If the table would be truncated, why I get unique constraint violation when inserting records from a table where the same unique constraint is validated?
    Here are the used parameter file content and the impdp logfile.
    parfile
    {code}
    DIRECTORY=IMPEXP_LOG_COLL2
    CONTENT=DATA_ONLY
    NETWORK_LINK=PRODUCTION
    PARALLEL=1
    TABLE_EXISTS_ACTION=TRUNCATE
    EXCLUDE=STATISTICS
    {code}
    logfile
    {code}
    Import: Release 10.2.0.1.0 - Production on Gioved� 22 Ottobre, 2009 15:33:44
    Copyright (c) 2003, 2005, Oracle. All rights reserved.
    Connesso a: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    FLASHBACK automatically enabled to preserve database integrity.
    Starting "IMPEXP"."PROVA_REFRESH_DBCOLL": impexp/********@dbcoll SCHEMAS=test_pump LOGFILE=test_pump.log parfile=refresh_dbcoll.par JOB_NAME=prova_refresh_dbcoll
    Estimate in progress using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 523 MB
    ORA-31693: Table data object "TEST_PUMP"."X10000000_TRIGGER" failed to load/unload and is being skipped due to error:
    ORA-00001: unique constraint (TEST_PUMP.SYS_C00726627) violated
    ORA-31693: Table data object "TEST_PUMP"."X10000000_BASIC" failed to load/unload and is being skipped due to error:
    ORA-00001: unique constraint (TEST_PUMP.SYS_C00726625) violated
    Job "IMPEXP"."PROVA_REFRESH_DBCOLL" completed with 2 error(s) at 15:34:04
    {code}
    Thank you
    Bye Alessandro

    I forgot to read the last two lines of the documentation about TABLE_EXISTS_ACTION where it says:
    "TRUNCATE cannot be used on clustered tables or over network links."
    So it seems that it ignored the clause for the use of NETWORK_LINK and unreasonably opted for an APPEND action instead of throwing an error to highlight the conflicting parameters in the used configuration.
    Bye Alessandro

Maybe you are looking for

  • Import and Export CSV Through XML File in Oracle

    Hi Gurus, I am sorry , I had deleted this post. Thanks Edited by: user10679113 on Feb 5, 2009 6:13 AM

  • WBS  Wise - G / l Account Number  Informations

    Hi All,         If any BAPI is available for getting G / L Acc Information in WBS wise .Plz give me  that names. Thankx advances,,,

  • SAP Business one Freight Query

    Hi experts, i have created a query in B1 query generator and saved . The purpose of the query is to calculate some values based on the group of the BP and the item code too. I used User-defined value but i get an error anytime i change my quantity. B

  • Web Banners

    Are there any good tutorials on creating Web Banners in Photoshop CC 2014.

  • Un able to re download PS

    There was an error when i down loaded PS and now it wont let me re download PS again  all the other downloads worked ok