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;

Similar Messages

  • VBScript - Identifying Rows that are too large for a page

    I am trying to write a VBScript that will identify rows that are too large to fit on a page.
    So far I have:
    Sub IfRowIsTooBigBreakAcrossPage()
    'Use to track number of tables in the document
    Dim t As Integer
    'Use to track number of rows in a Table
    Dim r As Integer
    'Get the number of tables in the document
    t = ActiveDocument.Tables.Count
    For i = 1 To t
    'Get the number of rows in a table
    r = ActiveDocument.Tables(i).Rows.Count
    For n = 1 to r
    If ActiveDocument.Tables(i).Rows(n).Height > 6 Then
    Active Document.Tables(i).Rows(n).AllowBreakAcrossPages = True
    End If
    Next
    Next
    End Sub
    I am having a hard time just getting this to run.   This is meant to run on tables that have been exported from IBM Doors.  I'm not sure if that [having been exported from Doors] is the issue or if I'm just missing something when it comes to the
    Rows attributes.
    Any help is appreciated!

    Hi David,
    I'm afraid that it is not the correct forum about this issue, since this forum is to discuss Visual Basic.
    For some reason, I can't help you to move this case to Scripting forum, please feel free to open a new thread in that forum for better response:
    http://social.technet.microsoft.com/Forums/en-US/home?forum=ITCG
    Thanks for your understanding.
    Best regards,
    Franklin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Read sql error log, skip lines that are in a exception list

    Could someone help, I am creating a nice powershell script to read a sql server log file but to skip lines that are normal in a sql server. the "normal lines are held in a SQL table.
    To expand.
    I run a query to get the list of exception lines using invoke-sqlcmd  this creates $TextEXP
    this will contain things like "Microsoft Corporation", "All rights reserved", "Starting up Database"
    I then connect to a sql server using SMO and want to read in the error log where the text is not matched the values in $textExpI want to avoid reading extra data and process it. I have a work round but its not a nice clean as its hardcoded the match.
    $ENV =$srv.ReadErrorLog()
    |? {  $_.text
    -notmatch'This
    is an informational message only'-and$_.text
    -notmatch'No
    user action is required'-and$_.text
    -notmatch'found
    0 errors'-and$_.text
    -notmatch'Microsoft
    Corporation.'-and$_.text
    -notmatch'All
    rights reserved.'-and$_.text
    -notmatch'Server
    process ID is'-and$_.text
    -notmatch'System
    Manufacturer: '-and$_.text
    -notmatch'Starting
    up database'-and$_.text
    -notmatch'Using
    ''dbghelp.dll'' version'-and$_.text
    -notmatch'Authentication
    mode is'-and$_.text
    -notmatch'Logging
    SQL Server messages in file '-and$_.text
    -notmatch'Setting
    database option'-and$_.text
    -notmatch'The
    error log has been reinitialized. See the previous log for older entries'-and$_.text
    -notmatch'Server
    is listening on '-and$_.text
    -notmatch'Registry
    startup parameters:'-and$_.text
    -notmatch'Clearing
    tempdb database'-and$_.text
    -notmatch'Service
    Broker manager has started'-and$_.text
    -notmatch'The
    Service Broker protocol transport is disabled or not configured'`
    -and$_.ProcessInfo
    -notmatch"Logon"-and$_.logdate
    -ge$Sdate}

    So after some looking about on the web I found that you can use the | in a string
    the following will give an idea of how to use this (this is not a clean bit of code but will give you a starting point)
    $TextEXP  this is a data table from sql server with the list of values I want to skip
    The field name (col name) is extext
    Set the string to be empty
    $exclusions = ""
    #Create a string with the values in $TextExp
    Foreach($value in $TextExp){
    $exclusions = $exclusions + "$($value.extext)|"
    #remove the last pipe from the string
    $exclusions = $exclusions.substring(0,$exclusions.length-1)
    ##This will create a long string value|value|value###
    $err = $srv.readerrorLog() | ?{$_.text - notmatch $exclusions}
    ###end
    May need bit of a clean up and may be a better way but seems to do what I need for now.
    Thanks all for the help

  • Count rows that are max timestamp

    Hi,
    I'm trying to run a query that will count only rows that are max timestamp.
    i have a submit table which has dates of submissions, however some application numbers have multiple rows in this table. I need to count only one row per application and it has to be the latest submission data.
    I have tried a subquery and its not working, I'm stuck at this point.
    Thanks for help :)
    example table
    pk app # submit_date
    12 test-1 02222011 13:30
    13 test-2 02232011 09:45
    14 test-1 02232011 09:51
    how do i count rows but based on max timestamp?

    select
    count(s.pk)
    from
    submit s
    where exists (select s1.app#, max(s1.submit_date) from submit s1 group by s1.app#)
    I dont really understand what you are doing there.
    SQL> WITH T
      2       AS (SELECT 12 pk, 'TEST-1' app#, SYSDATE submit_date FROM DUAL
      3           UNION ALL
      4           SELECT 13 pk, 'TEST-2' app#, SYSDATE + 1 submit_date FROM DUAL
      5           UNION ALL
      6           SELECT 14 pk, 'TEST-1' app#, SYSDATE + 2 submit_date FROM DUAL)
      7  SELECT * FROM T;
            PK APP#   SUBMIT_DA
            12 TEST-1 23-FEB-11
            13 TEST-2 24-FEB-11
            14 TEST-1 25-FEB-11
    SQL> WITH T
      2       AS (SELECT 12 pk, 'TEST-1' app#, SYSDATE submit_date FROM DUAL
      3           UNION ALL
      4           SELECT 13 pk, 'TEST-2' app#, SYSDATE + 1 submit_date FROM DUAL
      5           UNION ALL
      6           SELECT 14 pk, 'TEST-1' app#, SYSDATE + 2 submit_date FROM DUAL)
      7  SELECT   pk, app#
      8    FROM   (SELECT pk, app#, ROW_NUMBER () OVER (PARTITION BY app# ORDER BY submit_date DESC) rn
    FROM T)
      9   WHERE   rn = 1;
            PK APP#
            14 TEST-1
            13 TEST-2
    SQL>

  • How to get average between rows that are null?

    I need to get the average between the 2 positive numbers.
    Then update the table with the average for those rows that are NULL between the 2 positive numbers.
    The average will come (78+89)/2= 83.5. Round it to 84.
    Then it will be:
    6-4-13       84
    6-5-13        84
    6-6-13        84
    As for 6-9-13 and 6-10-13, those values will still be NULL.
    {code}
    create table dummy( tmestmp date
    ,maxtemp number(4,0));
    insert into dummy(tmestmp,maxtemp) values(to_date('20130601','YYYYMMDD'),70);
    insert into dummy(tmestmp,maxtemp) values(to_date('20130602','YYYYMMDD'),81);
    insert into dummy(tmestmp,maxtemp) values(to_date('20130603','YYYYMMDD'),78);
    insert into dummy(tmestmp) values(to_date('20130604','YYYYMMDD'));
    insert into dummy(tmestmp) values(to_date('20130605','YYYYMMDD'));
    insert into dummy(tmestmp) values(to_date('20130606','YYYYMMDD'));
    insert into dummy(tmestmp,maxtemp) values(to_date('20130607','YYYYMMDD'),89);
    insert into dummy(tmestmp,maxtemp) values(to_date('20130608','YYYYMMDD'),91);
    insert into dummy(tmestmp) values(to_date('20130609','YYYYMMDD'));
    insert into dummy(tmestmp) values(to_date('20130610','YYYYMMDD'));
    {/code}
    I need the output to look like this:
    Header 1
    Header 2
    01-JUN-13
    02-JUN-13
    03-JUN-13
    04-JUN-13
    05-JUN-13
    06-JUN-13
    07-JUN-13
    08-JUN-13
    09-JUN-13
    10-JUN-13
    70
    81
    78
    84
    84
    84
    89
    91
    null
    null
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    "CORE 10.2.0.4.0 Production"
    TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    Suggestions?
    TIA.
    Steve42

    select  tmestmp,
            nvl(
                maxtemp,
                round(
                       last_value(maxtemp ignore nulls)
                         over(order by tmestmp) +
                       first_value(maxtemp ignore nulls)
                         over(order by tmestmp
                              rows between 1 following and unbounded following
                      ) / 2
               ) maxtemp
      from  dummy
    TMESTMP                MAXTEMP
    06/01/2013 00:00:00         70
    06/02/2013 00:00:00         81
    06/03/2013 00:00:00         78
    06/04/2013 00:00:00         84
    06/05/2013 00:00:00         84
    06/06/2013 00:00:00         84
    06/07/2013 00:00:00         89
    06/08/2013 00:00:00         91
    TMESTMP                MAXTEMP
    06/09/2013 00:00:00
    06/10/2013 00:00:00
    10 rows selected.
    SQL>
    SY.

  • Hi! I got movies on my external hard drive that are AVI kind and won't play on my macbook pro? need some help please!!

    Hi! I got Movies on my external hard drive that are AVI kind and won't play on my macbook pro? When I start playing the movie a message pops up and says "a required codec is not available". I tried flip4mac, xvid, divx already and still not playing my video. need some help please!! thanks.

    Although vlc mentioned above is a much more powerful and better player you could try installing Perian if you insist on using the quicktime player.  It may supply the codec it needs.
    Not sure why you wouldn't be able to play straight avi files though in quicktime.

  • I recently lost my iphone.......and i have some confidencial data and pics in it....I want to make that are my data and pics secure r not?

    I recently lost my iphone.......and i have some confidencial data and pics in it....I want to make that are my data and pics secure r not?

    Well, if it is locked with a passcode; the only way for someone to use it would be for them to guess your passcode or restore it as new in iTunes. If they restore it, it wipes out all your information and puts the device back to factory settings.
     if you have iCloud setup; you can go to iCloud.com on a computer and sign in with your Apple Id and Password and you can possible track the device; also give the option to send a sound or message to the device; also you can remotely lock it with a passcode or remotely wipe it to factory settings;
    Hope this helps!!

  • HT1689 I deleted songs on my iPod that are still there and won't let me delete them again

    I deleted songs on my iPod that are till there and won't let me delete the agian. What should I do?

    - Try a reset. Nothing is lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Try syncing with iTunes
    - Restore from backup

  • Configuring UWL tasks that are created by a GP process

    Hello,
    We need help with configuring UWL tasks that are created by a GP process.
    In the portal (NW04s SP7), we went to System Admin > System Config > Universal Worklist Administration and then added a System called "GuidedProcedures" with the connector type "GuidedProceduresConnector".  But when we goto "Click to Administrate Item Types and View Definitions", the only gp system that we see is "uwl.gp.config".  So we have a few questions about this:
    1)     Should we be editing this XML file (uwl.gp.config)?  We were thinking that we should get another config file named uwl.GuidedProceduresConnector.<systemalias>.
    2)     Does each GP process have a unique ID? If yes, then how do we find that ID?
    Any help on this would be much appreciated…
    Thanks,
    Harman

    Hi Harman,
    There is no button to start a process directly from the UWL for ths simple reason that it is impossible to see a process template in the UWL (but in the GP Design Time).
    In the UWL, you can only display an overview of the Work Item. If you want display the form, I guess you use a Callable Object. There is unfortunetaly no possibility to do the thing differently. But, you could in the approval callable object display the input form (or a copie of it) as well as more information. For that, you could have a look at the time-off process delivered with the standard installation.
    Hope this helps you.
    Regards,
    David

  • Monitor Applications that are disconnected/offline and batch upload Insight data?

    Monitor Applications that are disconnected/offline and batch upload Insight data? does anyone know how to do this using Insight?
    MrAlikor - Coding away as Usually

    Could you elaborate on this please?
    Can an application remain disconnected for a day? a week? a month? Longer? 
    How long before data is lost? Does this depend on available disk space or another, lower, limit?
    What are the effects of aggregating data from a long disconnected instance? Is the historical aggregate information updated?
    What are the bandwidth requirements?
    Thanks in advance.

  • Please help. When exporting a 720p video using Quicktime Conversion in FCP it saves some extra temporary files to my computer. The file is called ICMMultiPassStorage. This file gets so large that eventually the program and exporting process crashes.

    Please help. When exporting a 720p video using Quicktime Conversion in FCP it saves some extra temporary files to my computer. The temporary file it saves is called ICMMultiPassStorage. This file gets so large that eventually the program and exporting process crashes. I have been able to locate the file using GrandPerspective and close out of FCP to delete it. But when I try exporting the movie again it creates the ICMMultiPassStorage file again. I have made sure my scratch disks are set to my external hard drive so I know that isn't the issue. How do I fix this problem so these temporary files are not being stored on my internal hard drive instead of my external?Thanks!

    Try exporting the timeline "using current settings" via Make QuickTime Movie, then submit that clip to Compressor for the transcode. This should be faster and less painful.

  • Does Roaming data syncs for the first time when app data are in download and installation process?

    Hi,
    I will store user Id in "HighPriority" Roaming data. When user will install app in another computer (with the same Microsoft Account), app will get user Id from Roaming data. Then I can implement all data sync over my cloud service.
    There are 2 scenarios:
    1. User downloads and installs app in another computer, but roaming data syncs/downloads for the first time only after several minutes -
    It's bad for my app :(
    2. User downloads and installs app in another computer and roaming data syncs/downloads at the same time (then I can get user Id immediately)
    - Its great for my app :)
    Which scenario is real in practice?
    Does Roaming data syncs for the first time when app data are in download and installation process?

    Umm no not that i remember. It just randomly started happening. I reformatted the hard drive for mac (journaled) but it was working fine since i did it until now

  • My iTunes program is giving me a message that says, "Runtime error" and wont open iTunes. How do I fix this?

    My iTunes program is giving me a message that says, "Runtime error" and wont open iTunes. How do I fix this?

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • When I try to print anything in Firefox, email or internet, I get a message that says printer error and nothing prints. Tried printing same stuff from Internet

    When I try to print anything in Firefox, email or internet, I get a message that says printer error and nothing prints. Tried printing same stuff from Internet Explorer it works fine.

    hello bdoolen, please try to [[Reset Firefox – easily fix most problems|reset firefox]] and see if this can address the issue...

  • HT201272 I want to download a previously purchased album that had an "error" and isn't complete. I have an older Mac and don't have iCloud. Surely there is some way to get the music I paid for!

    I want to download a previously purchased album that had an "error" and isn't complete. I have an older Mac and don't have iCloud. Surely there is some way to get the music I paid for!

    Hi,
    See this http://support.apple.com/kb/ht2519
    Jim

Maybe you are looking for