SUM...OVER... in OWB mappings

Hello,
I need to implement the following phrase in OWB mappings, how would I do it?
select lot, pdate, sum(rec_amount) over (order by pdate rows between unbounded preceding and current row) from S1;
Where S1 is the result of a set operator.
Thank you,
GH

Hi,
Thanks for the quick reply oleg. I got the sum()..over() clause working thanks to your screenshot. However, i got a little side problem here. The sum()..over() clause should take data in this form (product sales table)
PRODUCT 01/01 01/02 01/03 01/04 01/05
A 100 200 (null) 100 (null)
B 50 (null) 100 (null) 10
and turn it into something like
Product 01/01 01/02 01/03 01/04 01/05
A 100 300 300(*) 400 400(*)
B 50 50(*) 150 150(*) 160
The numbers in the above table that were attached to a (*) were not generated, however, since on those dates, no transaction occurred for such product. I need to have these days since the result of such table will be mapped to a MOLAP cube. If such number doesn't exist in the tables, it certainly won't exist in the MOLAP cubes, (right?) unless there are some procedures or functions that can automatically fill in those with (*) in the cube or elsewhere.
Please advise on this,
GH

Similar Messages

  • 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;

  • How to run OWB mappings from SQL*Plus

    Hi:
    I used to run OWB mappings using the sample code RUN_MY_OWB_STUFF in a customized PL/SQL procedure. This works for OWB 10g release 1 but not for OWB Paris (10g Release 2) because the execution always returns FAILURE.
    Is there something new in OWB Paris that RUN_MY_OWB_STUFF doesn't work anymore?
    Thanks,
    Hazbleydi C. Verástegui

    Hi Maruthi:
    I already check the input parameters of the mapping. I'm setting them as a custom parameters. This is the output of the execution:
    16:01:11 SQL> EXEC PR_RUN_OWBMAPPING_TABLA2('MPG_EMPLEADOS_NOMINA_PERIODO',2007,01);
    Stage 1: Decoding Parameters
    | location_name=LOC_DM_STAGING
    | task_type=PLSQL
    | task_name=MPG_EMPLEADOS_NOMINA_PERIODO
    Stage 2: Opening Task
    | l_audit_execution_id=39635
    Stage 3: Overriding Parameters
    | P_ANO%CUSTOM='2007'
    | P_MES%CUSTOM='1'
    Stage 4: Executing Task
    | l_audit_result=3 (FAILURE)
    Stage 5: Closing Task
    Stage 6: Processing Result
    | exit=3
    By the way, RUN_MY_OWB_STUFF is the same as RUN_OWB_CODE.sql except for the two first parameters (p_result and p_audit_id):
    create or replace procedure run_owb_code
    ( p_result out number
    , p_audit_id out number
    , p_repos_owner in varchar2 default null
    , p_location_name in varchar2 default null
    , p_task_type in varchar2 default null
    , p_task_name in varchar2 default null
    , p_system_params in varchar2 default '","'
    , p_custom_params in varchar2 default '","'
    , p_oem_friendly in number default 0
    is
    CREATE OR REPLACE function run_my_owb_stuff
    ( p_repos_owner in varchar2 default null
    , p_location_name in varchar2 default null
    , p_task_type in varchar2 default null
    , p_task_name in varchar2 default null
    , p_system_params in varchar2 default '","'
    , p_custom_params in varchar2 default '","'
    , p_oem_friendly in number default 0
    ) return number
    is
    How do you invoke your wrapper PL/SQL with these two first parameters?
    Thanks in advance,
    Hazbleydi C. Verástegui

  • Want to run owb mappings thru job schedule

    hi all,
    need some help here. hope u guys can give me an idea. all this while i've been executing my owb mappings thru the deployment manager. instead of doing so, can i execute the mappings thru scheduling?? if yes, how can i do it??
    i've tried using the OMS. From there i can create some jobs, but it's not taking from the mappings. i'm still trying. hope to get some good tips on how to do it. thanks in advance.

    Hmm, trying to execute it from the 10g web OEM, I ran into a problem - it returns the following:
    ORA-27370: job slave failed to launch a job of type EXECUTABLE ORA-27300: OS system dependent operation:accessing execution agent failed with status: 2 ORA-27301: OS failure message: The system cannot find the file specified. ORA-27302: failure occurred at: sjsec 6 ORA-27303: additional information: The system cannot find the file specified.
    I'm wondering, since I have logged in locally on the server, and the file really do exist...
    You have a clue?
    Yours
    Kim

  • How to migrate OWB mappings in ODI

    Dear All,
    I would require your valuable inputs for following points.
    1. How do we do the deployment on multiple sites in ODI? what is the methdology or steps? R there any third party tools to do the same? what are they?
    2. Is there any scripting language in ODI similar to OMB meta data scripting languate as in OWB which can be used to automate and speed up the multi site deployment?
    3. What is the process of step to convert OWB mappings to ODI interfaces? Does oracle provides any tools or methodology to do the migration from OWB to ODI.?R there any third party tools to do the same? what are they?
    Thanks and Regards
    Edited by: 910192 on Aug 16, 2012 10:22 PM
    Edited by: 910192 on Aug 16, 2012 11:54 PM

    910192 wrote:
    Dear All,
    I would require your valuable inputs for following points.
    1. How do we do the deployment on multiple sites in ODI? what is the methdology or steps? R there any third party tools to do the same? what are they?If you mean databases as 'sites' then you just configure seperate phyiscal connections and choose if you want to implicitly refer to each DB in your code or use Contexts to determine which database to use at run time.
    Also careful consideration / deployment of ODI Agents allow you to run / execute / invoke you code from just about anywhere you want to (Target database, remote file system, source servers etc)
    2. Is there any scripting language in ODI similar to OMB meta data scripting languate as in OWB which can be used to automate and speed up the multi site deployment?There is an SDK and groovy can be used : https://blogs.oracle.com/dataintegration/entry/odi_11g_insight_to_the
    3. What is the process of step to convert OWB mappings to ODI interfaces? Does oracle provides any tools or methodology to do the migration from OWB to ODI.?R there any third party tools to do the same? what are they?Not sure if Oracle have formally released a step by step process yet, they promise an upgrade path to OWB users to migrate, there is a consulting offer for this : http://www.oracle.com/us/products/consulting/resource-library/owb-odi-migration-ds-1367824.pdf
    ALso an italian company has / is developing a migration tool : http://www.owb2odiconverter.com/eng/index.html

  • OWB Mappings write data extremely sparse

    We discovered that some tables, which get some new records by several OWB Mappings every night, are filled extremely sparse. In most blocks we find only one record even if the average record size is some 60 bytes and the blocksize is 8k. Only in a few blocks there are up to 18 records and every night nearly the same - but not exactly the same - mappings write their data in one block together, while all other mappings use a separate block. When we move all records to a temporary table, truncate the original table and move all records back, every block is filled with 110 to 120 records but in the next night the new records are sparse again.
    I moved the problematical tables from an ASSM managed tablespace to a manually managed tablespace and increased the number of freelists to 2 but this made no difference in the behavior. Is there any explanation for this conduct of the database? Is there a known bug in 10.2.0.3 (it’s not up to date, I know) which leads to this result?

    As the problem still exited after changing to database version 11.2.0.3 I opened a new thread for this topic: Empty blocks are not used for inserts
    It seems that the problem occured, because OWB uses the APPEND hint by default for mappings, which is inadequate when only single rows are written to a log table.

  • How to implement Lag over  in OWB?

    Hi,
    Could any one please explain, how we can implement lag over in OWB?
    Thanks and regards
    Gowtham Sen.

    Hi Borkur,
    Thanks for reply.
    Actually I want to implement it in OWB. But after I got the answer from you, I decided to do in some othere way.
    The way you mentioned is right when we are performing the operations directly on a table.
    But in my scenario, an intermediate data is generating. I want to perform lag over operation on those records. Its possible by view.
    So for performing operations for intermediate result, Oracle is providing Table Function concept. I can pass the result to it.
    But the problem again is, how to implement the lag over operation there.
    Any idea.?
    Thanks and regards
    Gowtham sen.

  • How to wrap OWB mappings?

    Hi,
    Can anyone guide me how to wrap the OWB mappings. At the production site, we do not want the client to open the OWB client and see the mappings. Even when we send the upgrades (add mappings to the project), also the client should not open the project and do it from OWB. pls post your suggestions.
    Thanks,
    Kishan

    Hi,
    Can anyone guide me how to wrap the OWB mappings. At
    the production site, we do not want the client to
    open the OWB client and see the mappings. Even when
    we send the upgrades (add mappings to the project),
    also the client should not open the project and do it
    from OWB. pls post your suggestions.
    Thanks,
    KishanKishan... Perhaps it is your choice of words but it seems like you are trying to hide your implementation from the customer? This customer will blindly run a script you deliver without even the ability to examine your work? That is a very trusting customer... one that wishes to not participate in any review (even high level) of your solution.
    Indeed... OMB will work... If you need more control you could consider using the Java API provided as well... However, if this is a customer with which you've established trust they could also provide you with VNC/ssh -x/other remote access. After all, even if the script runs perfectly 100 times at your location there still might be issues with deployment at theirs. It would be tough to build an OMBPlus script to "troubleshoot" these types of things, yes?
    Good luck...

  • How to call OWB Mappings?

    Hi,
    I need to call the OWB mappings from an Oracle stored procedure.How can I implement this?
    Regards
    Kishan

    Hi Kishan,
    Use sqlplus_exec_template.sql in <OWB_HOME>\owb\rtp\sql\.
    Alternatively you can use similar code provided by OWB-team: http://www.oracle.com/technology/sample_code/products/warehouse/files/run_my_owb_stuff.sql
    Good luck, Patrick

  • Migrating from Dev repository to Production repository..owb mappings..

    We have OWB 9i with Oracle 9i in Dev Repository.
    We are currently in Development phase.But sooner will be migrating to production. I am new to this kind of process of migration.
    How do we go about migrating OWB mappings from development Repository to Production repository.
    Any suggestions would be helpful.It's URGENT !!
    thanks.

    I recommend you to post this in:
    Forums Home » Oracle Technology Network (OTN) » Technologies » Data Warehousing and Business Intelligence
    http://forums.oracle.com/forums/index.jsp?cat=16
    Joel Pérez

  • How to call owb mappings using Control M

    Hi Guru's,
    Please help me with the script/steps  for calling OWB mappings in Control M.
    Thanks in advance!

    Hi Kishan,
    Use sqlplus_exec_template.sql in <OWB_HOME>\owb\rtp\sql\.
    Alternatively you can use similar code provided by OWB-team: http://www.oracle.com/technology/sample_code/products/warehouse/files/run_my_owb_stuff.sql
    Good luck, Patrick

  • Calling OWB mappings within apply handlers

    Hi,
    I have configured streams to capture changes in my source tables. And in my apply process, I have set apply handlers which try to call OWB mappings for populating data into destination tables. But I am getting an error while doing so -
    ORA-20213: Unable to create standalone job record - there may be no task defined for this map
    How can i solve this problem?
    Thanks
    Giri

    Hi Giri,
    First of all some good news. We are adding exactly this functionality to the new release of OWB (soon to be in beta).
    Now for solving this, there is another thread on the forum about this. I have not tried this myself, but if you are calling this from pl/sql you may want to use the example on OTN (run_my_owb_stuff.sql) which you can find here: http://www.oracle.com/technology/sample_code/products/warehouse/index.html
    That will create a procedure that you can call from the apply handler.
    Hope this points you in the right direction,
    Jean-Pierre

  • Migrating all OWB Mappings

    Hi Everyone,
    Can anybody explain to me the steps to migrate all the OWB Mappings.
    Currently all my mappings are in 11.1.0.6 version and i want to migrate them to 11.1.0.7 version.
    Regards
    Subhasree

    Hi Subhasree ,
    You can export the mdl of all your mappings from 11.1.0.6 and then import it into 11.1.0.7 .
    You need to make sure the all referenced objects like table,view, sequence are already there in 11.1.0.7 .
    You can do that by doing export/import of mdl of those objects .
    Thanks,
    Sutirtha

  • Migrating OWB mappings

    Hi Everybody,
    I have all my OWB mappings on oracle 11.1.0.6. I want to migrate all my mappings to 11.1.0.7. so can anyone explain me the detailed steps involved in performing the migration?
    This is very urgent.
    Thanks in advance
    Regards
    Subhasree

    HI Subhasree,
    version number is an characteristic of OWB repository or OWB software and not relates to mapping.
    Please be more specific what you want to do (import MDL file created by OWB 11.1.0.6 into 11.1.0.7 repository, move metadata from OWB repository 11.1.0.6 to 11.1.0.7, or upgrade OWB repository to 11.1.0.7, or upgrade target database to 11.1.0.7, ...)
    Regards,
    Oleg

  • Wrapping owb mappings

    Hi all
    We have owb mappings which I want to include in as part of a custom software. We would be delivering the solution to the client. Is it required for client to have owb installed can't they use the packages created by the mapping.
    I want to run these mapping at client site so want to wrap them within a custom software as a whole. what is the best approach? how can I use these mappings at the client site how do I use these.
    Pls post your suggestions

    Hi,
    you can wrap the package bodies with http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/wrap.htm.
    You need a repository on the server where you want to run the mappings. Normally you need a owb installation too. Otherwise you must create a clone of the rep using a dump.
    Regards,
    Detlef

Maybe you are looking for

  • Increasing size of the bootcamp partition

    What is the easiet way to do this without having to wipe the partition clean and reinstall windows? Thanks

  • How do i change marker color and fill in a chart

    Hi, In a chart in keynote - I am struggling to find a way to change the color of the marker of a data series. Also cannot seen to customize the fill and line of the marker. Can someone provide guidance. Y

  • Is there any class similar as cl_GUi_alv_grid  for normal report

    we have a requirement to put one report some part of in the screen. so we know there is class on which we can display ALV i.e "cl_GUi_alv_grid".in the same way is there any class in which we can use as a normal report. right now i have an idea of kee

  • SCCM 2012 moving site Database server from SQL 2008 R2 cluster to 2012 cluster

    Hello,<o:p></o:p> Using the SCCM 2012 setup, I get the following errors and then it eventually fails--I've been uninstalled and installed SQL native client .....still unable to move SQL database,i get this error:<o:p></o:p> *** Failed to connect to t

  • HELP - service order analysis

    I'm new in the SAP community. I'm a business analyst not yet experienced. I need your support to find a report within SAP or BW containing info about nr. of delivery linked to each orderlines in a certain period . My  goal is to measure the quality o