Wb_rt_api_exec in pl/sql as OWB target

I've got a question similar to the one posted by Donna Kelley on 26-mar-2007 (
Re: 10gR2: How do you run OWB from Enterprise Manager (OEM) and Scheduler?
I'm unable to figure out the grants needed to execute wb_rt_api_exec.run_task within a pl/sql procedure when the procedure is being run by the OWB target user.
We just upgraded OWB in devo from 10.1.0.4 to 10.2.0.1.31. In the earlier version, there was no problem with the target user executing wb_rt_api_exec (although we used open, execute, close instead of run_task). The runtime repository owner granted execute on wb_rt_api_exec to the target schema. And then the 2 roles wb_r_owbruntime and wb_u_owbruntime were also granted to target. That's all it required.
In the new version, I can execute wb_rt_api_exec only as the design repository owner. I've granted the target user execute on wb_rt_api_exec. Also granted the 2 roles owb_d_owbowner and owb_o_owbowner roles to the target user (see sqlplus_exec_template.sql). But within a pl/sql procedure with the procedure run as the target user, the return code is 3 (failure). I can also not run sqlplus_exec_template as the target user. But I can run it successfully as the design repository owner.
This seems strange. We're running ETL mappings to populate target tables. It should be easy to run the pl/sql procedure as the target user. I don't want to run it as the repository owner because that would involve a bunch of grants on target tables. Seems silly.
I'd welcome any thoughts and advice.
Many thanks.
Gary

First, David, thanks very much for your help. Based on your example, what I'm trying to do should work.
Below is a very simplified example that demonstrates the problem. Note that executing the procedure as the target user produces an error (ie, the return value is 3) while executing it as the design repository owner succeeds.
Comments and advice are welcomed from all. I very well could be missing something obvious. Thanks to all.
devo> @who
OWBTARGET
devo> start t1
devo> create procedure t1 authid current_user as
2      sql_stmt varchar2(50) := 'set role owb_d_owbdesign, owb_o_owbdesign';
3 begin
4      execute immediate sql_stmt;
5      dbms_output.put_line(to_char(owbdesign.wb_rt_api_exec.run_task(
6      'RPTDEVO_LOC', 'PLSQLMAP', 'TERM_TO_DMS_CURR', ',', ',', 0, 0)));
7 end;
8 /
Procedure created.
devo> grant execute on t1 to owbdesign;
Grant succeeded.
devo> exec t1
Stage 1: Decoding Parameters
| location_name=RPTDEVO_LOC
| task_type=PLSQLMAP
| task_name=TERM_TO_DMS_CURR
Stage 2: Opening Task
| l_audit_execution_id=5390
Stage 3: Overriding Parameters
Stage 4: Executing Task
| l_audit_result=3 (FAILURE)
Stage 5: Closing Task
Stage 6: Processing Result
| exit=3
3
PL/SQL procedure successfully completed.
devo> @check_role_privs owbtarget
devo> select grantee "grantee",
2      granted_role "role",
3      admin_option "option"
4 from dba_role_privs
5 where grantee = upper('&1')
6 order by 2
7 ;
admin
grantee role option
OWBTARGET AQ_USER_ROLE NO
CONNECT NO
OLAP_USER NO
OWBR_OWBDESIGN NO
OWB_D_OWBDESIGN NO
OWB_OWBDESIGN NO
OWB_O_OWBDESIGN NO
RESOURCE NO
SELECT_CATALOG_ROLE NO
9 rows selected.
devo> connect owbdesign
Connected.
devo> @who
OWBDESIGN
devo> exec owbtarget.t1
Stage 1: Decoding Parameters
| location_name=RPTDEVO_LOC
| task_type=PLSQLMAP
| task_name=TERM_TO_DMS_CURR
Stage 2: Opening Task
| l_audit_execution_id=5400
Stage 3: Overriding Parameters
Stage 4: Executing Task
| l_audit_result=1 (SUCCESS)
Stage 5: Closing Task
Stage 6: Processing Result
| exit=1
1
PL/SQL procedure successfully completed.

Similar Messages

  • Executing interface for a SQL Server 2000 target

    Hi All,
    I am trying doing some initial experimentation with ODI, in executing its interface in compiling a SQL Server 2000 target from the same source.
    I designed an interface with Source and target having only one column, inserted some sample data for the source data store and left the target empty. After reversing the source and target data models, created an interface and inserted source and target datastores and active mapped the existing column. In the flow tab, I am using LKM MSSQL to MSSQL(Linked Servers) and IKM MSSQL Incremental Update and rectified Flow Control to 'No' as I dont have any keys in my structure. I am using CKM SQL, though no necessity of it, and also tried with LKM MSSQL to MSSQL(BCP), but could not correct the error when executing this interface.
    It is not indicating any errors in diagram. In the Operator this is what is the message:
    1038 : S0003 : com.microsoft.sqlserver.jdbc.SQLServerException: Cannot use empty object or column names. Use a single space if necessary.
    com.microsoft.sqlserver.jdbc.SQLServerException: Cannot use empty object or column names. Use a single space if necessary.
         at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(Unknown Source)
         at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(Unknown Source)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.h.y(h.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    Moreover in the command prompt it is indicating SQL Server Exception: Cannot invoke a rollback operation when the autocommit mode is set to true.
    Please help me out in executing this interface, all help is greatly appreciated.
    Many Thanks!!!

    Hi Rathish,
    In the query it is indicating that 'It is creating view on target'. This is the step that is causing trouble.
    Query description is :
    create view dbo.C$_0City_Trg
    as
    select      *
    from     [].odi_work.dbo.City_Trg
    Thanks in Advance!!!

  • Using Dynamic SQL in OWB maps

    Hi,
    Is there any way that we can write dynamic SQL in OWB.As per my requirement i want to change the where clauses dynamically on need basis.
    Thx

    David,
    I want to change the where clause dynamically.Our objective is to make the map in a generic way so that if there is a change in where clause (i.e. adding more conditions in where clause) i dont have to change the map.I can change the values(if used, say emp_no=20) however i'm facing problem changing the whole condition i.e. even the column name.
    Thx

  • SAS database as OWB Target

    How can we have SAS Database as OWB target?

    Good morning.
    Not possible, certainly not since OWB leans heavily on database functionality provided by the Oracle database.
    Check the installation and configuration guide chapter 1 (Warehouse Builder Installation Requirements) paragraph 1.3.2 (Required Products), table 1.3 Software Required for a Complete Warehouse Builder Environment:
    Software (Required and Optional)
    Oracle Database (Required) <<<==== this is the most important bit of all
    The following versions of Oracle Database are supported:
    &#9632; Oracle Database 10g
    &#9632; Oracle9i Release 2 (9.2.x)
    &#9632; Oracle8i Release 3 (8.1.7.4.x)
    Refer to Figure 2–1 on page 2-2 for information on the recommended installation configuration.
    Components Used by Warehouse Builder
    &#9632; Oracle Database server with the Oracle XML Toolkit option
    &#9632; Oracle Agent
    &#9632; TNS Listener
    &#9632; Oracle HTTP Listener and Apache Server (Optional)
    Oracle HTTP Listener and Apache Server are necessary to enable the client version of the Warehouse Builder Design Browser,used to view and report on your ETL design metadata.
    Cheers, Patrick

  • Error calling pl/sql function in target column

    Hi guys,
    I get this error when calling my function in ODI:
    Caused By: java.sql.SQLSyntaxErrorException: ORA-00904: "mySchema"."GET_ODI_DEFAULT_VALUE(1)": ongeldige ID --> 1 is an IN parameter
    while in sql developer I get a good result with following query:
    select mySchema.get_odi_default_value(1) from dual;
    In my target table for the primary key I call a sequence from mySchema and this works fine.
    I've tried the following synxtax in the mapping of my target column:
    - <%=odiRef.getObjectName( "L","GET_ODI_DEFAULT_VALUE(1)", "D" )%>
    - <%=odiRef.getObjectName( "L","GET_ODI_DEFAULT_VALUE", "D" )(1)%>
    Thanks for you advice

    iadgroe wrote:
    how to bring oracle function into ODI
    I thought for objects like sequences and functions you had to use 'odiRef.getObjectName' to get access to them.
    Am I wrong because now I'm a little confused???Hi,
    Best practices would be to use getobjectname method as this way your not hardcoding anything into the interface and you are referencing the logical object only, which means you can change the logical object later and not have to worry about changing the interfaces.

  • Oracle Source TO MS SQL Server 2005 Target

    Hi there,
    I need to extract data from my Oracle DW and push it into a dependant system's Microsoft SQL Server 2005 DB.
    Could someone PLEASE give me some pointers?
    Oracle DB 10.2.0.4.0
    OWB 10.2.0.1
    Thanx!
    Edited by: Gun77 on 2009/08/12 8:48 AM

    Hi Gun77 !
    As i knew, ODBC Generic Connectivity Agent is an API which use for connect other RDBMS. Don't care cost because it's free.
    In other way, u can use Oracle Generic Connectivity Agent to any DB (SQL server, MySQL,…)
    Download the orajdbclink_o2a.zip (oracle-to-any) file:
    http://sourceforge.net/project/showfiles.php?group_id=205664
    u can see detail in this link:
    http://duykhanh.wordpress.com/2009/08/05/oracle-dblink-to-any-db-sql-server-mysql%E2%80%A6/
    Hope good for you!
    KhanhND (ZyK)

  • How to implement dynamic sql in owb

    Hi everybody,
    I am new to OWB and hence i want to know how i can implement the following dynamic sql statement in owb...
    Declare
    Cursor C_tab_col is
    Select cat from tbl_cat_edesc_1 ;
    Vcat varchar2(240);
    Cursor C_edesc_col is
    Select edesc from tbl_cat_edesc_1 ;
    Vedesc varchar2(240);
    V_Command varchar2(30000);
    Begin
    Open C_Tab_col;
    Fetch C_tab_col into vcat;
    Open C_edesc_col;
    Fetch C_edesc_col into vedesc;
    loop
    V_Command := 'update upd_catseg_1 c set c.'||vcat||'=';
    V_Command := V_Command||'(select d.sales from TEST_catseg d' ;
    V_Command := V_Command||' where edesc = '||''''||vedesc||''''||' and c.cardno=d.cardno)';
    dbms_output.put_line('10 '||V_command);
    Execute immediate v_command;
    Fetch C_tab_col into vcat;
    Exit when c_tab_col%notfound;
    Fetch C_edesc_col into vedesc;
    Exit when c_edesc_col%notfound;
    end loop;
    commit;
    end;
    Thanks a many

    Hi,
    first i have created a procedure witht he following code in the code editor...
    BEGIN
    Declare
    Cursor C_brand_col is
    Select cat from TBL_CAT_EDESC_BRAND ;
    Vbrand varchar2(240);
    Cursor C_bredesc_col is
    Select EDESC_BRAND from TBL_CAT_EDESC_BRAND;
    Vbredesc varchar2(240);
    V_Command varchar2(30000);
    Begin
    Open C_brand_col;
    Fetch C_brand_col into vbrand;
    Open C_bredesc_col;
    Fetch C_bredesc_col into vbredesc;
    loop
    V_Command := 'update sav_fc_sa_pc c set c.'||vbrand||'=';
    V_Command := V_Command||'(select d.fc_brands_sa from TEST_brand d' ;
    V_Command := V_Command||' where d.brand_edesc = '||''''||vbredesc||''''||' and c.cardno=d.cardno)';
    dbms_output.put_line('10 '||V_command);
    Execute immediate v_command;
    Fetch C_brand_col into vbrand;
    Exit when c_brand_col%notfound;
    Fetch C_bredesc_col into vbredesc;
    Exit when c_bredesc_col%notfound;
    end loop;
    commit;
    end;
    END;
    then i validate it and deply it..
    after that i create a mapping and in that mapping i first import the table TBL_CAT_EDESC_BRAND and drag and drop it into the mapping and again the i put the procedure into a transformation operator and connect the inoutgrp of the table to the transformation operator ingrp deploy it and run it...this is taking a lot of time .... so i am not sure whether i am doing the right thing...for this dynamic sql i dont need to pass any parameters. can i juz execute this procedure or should i create a mapping ???? i am totally confused... could you please help me.....how to proceed........
    if i juz execute the dynamic sql it takes only 5 min in sql but i am not sure how ti implement it in owb... can you please help...
    Thanks a many

  • How to load  a tables one partition of data in to OWB target table

    Hey ,
    I want to load only one partition data from source (size in Tera bytes) in OWB tables. I used filter condition as per the partition done on a key value. But Its take so much time to load the data into the target table.
    I feel to configure the source table as well as target table and give some HINT command in operator settings . Is it right to improve the performance of loading .
    Can I use PEL option in source as well as target .
    suggest me please
    thanks
    murari

    Hi Andreas,
    This error has not been documented yet, but I got the information from the other forums.
    Error Name                            Error Code (hex)    Description
    LinBusErrorTxSyncTimeout         1040                  The LIN interface master task attempted to send a
                                                                               sync byte and did not self not receive the sync byte
                                                                               within the timeout period.
    This is the description. The problem is solved, the baud rate i was giving was higher than the slave units baud rate. Now it seems to be functioning correctly.
    Thank you.

  • OWB Target Schema Tables

    OWB installs some tables under the target schema (including, for example, WB_RT_PARAMETERS, WB_RT_PLATFORM_PROPERTIES). These tables are in the same schema as all of our application target tables. Our DBAs want to know:
    (1) Is there some way to have OWB build all these tables under a schema separate from the schema in which all of our application tables reside?
    And, if not:
    (2) Is there some way to identify the tables (and other objects) created by OWB. Are they only the objects prefixed with WB? Or are there others?
    The DBAs would like to script some changes to the tables in our target schema but of course do not want to modify the OWB-specific tables, so we would like to identify the objects that are OWB-specific.

    Barbara,
    Following are all objects in a new target schema:
    FUNCTION OWBRTPS_KEY_TO_INSTANCE
    OWBRTPS_KEY_TO_VERSION
    OWBRTPS_KEY_TO_VERSION_STRING
    WB_CAL_MONTH_NAME
    WB_CAL_MONTH_OF_YEAR
    WB_CAL_MONTH_SHORT_NAME
    WB_CAL_QTR
    WB_CAL_WEEK_OF_YEAR
    WB_CAL_YEAR
    WB_CAL_YEAR_NAME
    WB_DATE_FROM_JULIAN
    WB_DAY_NAME
    WB_DAY_OF_MONTH
    WB_DAY_OF_WEEK
    WB_DAY_OF_YEAR
    WB_DAY_SHORT_NAME
    WB_DECADE
    WB_HOUR12
    WB_HOUR12MI_SS
    WB_HOUR24
    WB_HOUR24MI_SS
    WB_IS_DATE
    WB_IS_NUMBER
    WB_IS_SPACE
    WB_JULIAN_FROM_DATE
    WB_MI_SS
    WB_RT_INTEGER_VERSION_NUMBER
    WB_RT_IS_PLATFORM_REPOSITORY
    WB_RT_MINIMUM_SERVICE_VERSION
    WB_RT_PLATFORM_REPOSITORY
    WB_RT_VERSION
    WB_WEEK_OF_MONTH
    WB_XML_LOAD_F
    INDEX PK_RTL
    PP_PK
    PP_UK
    SYS_C0036660
    SYS_C0036661
    SYS_IOT_TOP_101865
    WB_RT_PARAMETERS_PK
    JAVA CLASS oracle/wh/resource/RuntimeXMLExceptions
    oracle/wh/runtime/mm/Alg
    JAVA RESOURCE META-INF/MANIFEST.MF
    LOB SYS_LOB0000101839C00003$$
    SYS_LOB0000101942C00002$$
    PACKAGE OWBXMLTK
    OWB_MATCH_MERGE
    WB
    WBRTTIME
    WB_RT_MAPAUDIT_UTIL
    PROCEDURE WB_ABORT
    WB_ANALYZE_SCHEMA
    WB_ANALYZE_TABLE
    WB_COMPILE_PLSQL
    WB_DISABLE_ALL_CONSTRAINTS
    WB_DISABLE_ALL_TRIGGERS
    WB_DISABLE_CONSTRAINT
    WB_DISABLE_TRIGGER
    WB_ENABLE_ALL_CONSTRAINTS
    WB_ENABLE_ALL_TRIGGERS
    WB_ENABLE_CONSTRAINT
    WB_ENABLE_TRIGGER
    WB_OLAP_LOAD_CUBE
    WB_OLAP_LOAD_DIMENSION
    WB_OLAP_LOAD_DIMENSION_GENUK
    WB_TRUNCATE_TABLE
    WB_XML_LOAD
    SEQUENCE WB_RT_MONTH_SEQ
    WB_RT_PLATFORM_PROPERTIES_SEQ
    WB_RT_QUARTER_SEQ
    WB_RT_TEMPCONS_SEQ
    WB_RT_TEMPINDEX_SEQ
    WB_RT_TEMPTABLE_SEQ
    WB_RT_WEEK_SEQ
    WB_RT_YEAR_SEQ
    TABLE CREATE$JAVA$LOB$TABLE
    JAVA$CLASS$MD5$TABLE
    WB_RT_EXCEPTIONS
    WB_RT_PARAMETERS
    WB_RT_PLATFORM_CONFIG
    WB_RT_PLATFORM_PROPERTIES
    WB_RT_POSTLOAD_EXCEPTIONS
    WB_RT_SEEDED_STRINGS
    WB_RT_TIME_SRC
    TRIGGER WB_RT_PARAMETERS_AUDIT
    WB_RT_SEEDED_STRINGS_AUDIT
    I.e. most objects start with WB... a few are created as part of the deployment of Java to the database (some of the tables and the LOBs). Unfortunately, as you notice, there are still a few OWB objects that do not start with OWB. If you drop all WB objects and OWBRTPS_KEY_TO_INSTANCE, OWBRTPS_KEY_TO_VERSION, OWBRTPS_KEY_TO_VERSION_STRING, I think all Warehouse Builder objects will be removed.
    The objects are there to enable remote node installation. If you remove the definitions... then unfortunately you are not supported, even though I am sure you can get things to work with synonyms instead of tables.
    Thanks,
    Mark.

  • Unlicenced Options in OWB- target load ordering & variables in workflows

    In need to perform overall repository check-up , to see if unlicenced "features" : Target Load Order and Variables in Workflows have been used in Mappings.
    Ideally, I would just like to wirte a query, to "comb" the repository and find the offending Mappings and Workflows.
    The problem is : I don't know which tables to query - the view structure in Repository is pretty complex. The view ALL_IV_OBJECT_CONFIGURATIONS seemed like a good starting point for detecting usage of target load ordering but I kept getting ORA-22835(since there are CLOBS in underlaying tables) and couldnt get rid of that , since there are 10 levels of sub-views underneath-so I lost track and am not sure which column refers to CLOB any more..
    Can anybody help me ? Is there a way at all to retrieve this kind of information from the repository ?
    Edited by: Reggy on 01.09.2010 03:13
    Edited by: Reggy on 01.09.2010 03:14
    Edited by: Reggy on 01.09.2010 03:15

    Reggy,
    for list of used variables in processflow use ALL_IV_PROCESS_VARIABLES OWB public view.
    Regarding Target Load Order - maybe using ONLY configuration property Target Load Ordering is not the base case because this flag enabled by default for new mapping. You need to perform additional check - that mapping contains more then one target table.
    I cannot help with ALL_IV_OBJECT_CONFIGURATIONS view (ORA-22835, on OWB 10.2.0.3 have same error), instead try OMB*Plus script like this
    OMBCC '/PROJ/TARGET_MODULE'
    set mapList [OMBLIST MAPPINGS]
    foreach mapName $mapList {
      # it is a configuration property Use Target Load Ordering
      set targetOrderFlag [OMBRETRIEVE MAPPING '$mapName' GET PROPERTIES(TARGET_LOAD_ORDERING)]
      # it is coma separated list of target tables
      set targetTabList [OMBRETRIEVE MAPPING '$mapName' GET PROPERTIES(TARGET_LOAD_ORDER)]
      # check that targetTabList contains more than one tables
    }Regrads,
    Oleg

  • SQL SERVER - OWB connectivity - Urgent

    Hi,
    I need help in setting up a DSN for sql server.
    Oracle and OWB in Unix machine.
    Sql server is in windows.
    I need to create a DSN in unix which connects to sql server machine.
    For this which ODBC (SQLSERVER ODBC or ORACLE ODBC) I need to install and the steps to create a DSN for SQL SERVER in UNIX machine.
    Thanks in advance.
    -- Harsha

    Hi Harsha,
    look this
    Re: How to import the data in a .xls or .xlsx file into a oracle database table
    Regards,
    Oleg

  • Help two sql queries toload target table

    create table table1
        (code varchar2(10)
         ,mod_time date);
         insert into table1 values('2533',to_date('31-JUL-2012', 'DD-MON-YY'));
         insert into table1 values('2534',to_date('31-JUL-2012', 'DD-MON-YY'));
          insert into table1 values('2535',to_date('01-SEP-2012', 'DD-MON-YY'));
          create table table2
        (code varchar2(10)
         ,ID   NUMBER
         ,TYPE VARCHAR2(3)
         ,mod_time date);
         insert into table2 values('2533',1,'AB',to_date('01-SEP-2012', 'DD-MON-YY'));
         insert into table2 values('2534',1,'CD',to_date('01-SEP-2012', 'DD-MON-YY'));
         create table table3
         (ID   NUMBER
          ,mod_time date);
          insert into table3 values(1,to_date('01-SEP-2012', 'DD-MON-YY'));
          insert into table3 values(2,to_date('01-SEP-2012', 'DD-MON-YY'));
          create table target
          (code varchar2(10)
          ,ID   NUMBER
          ,TYPE VARCHAR2(3)
          ,table1_modtime date
          ,table2_modtime date
          ,table3_modtime date
          ,valid_till  date
          ,valid_from  date
          drop table target
          combine all the three tables where table1.mod_time<=31-jul-2012, table2.mod_time<=31-jul-2012,table3.mod_time<=31-jul-2012
          initial load to target load should be get the information from all the tables modtime<=31-jul-2012
          Need to have select query to get the below 1st load expected output
          valid_till defaults to to_date('31-DEC-2030', 'DD-MON-YY')
          valid_from defaults to to_date('01-01-1995', 'DD-MON-YY')
         1st load expected output
          code    id     type  table1_modtime   table2_modtime      table3.modtime  valid_from valid_till  
          2533                 31-JUL-2012                                                            01-01-1995  31-DEC-2030 
          2534                 31-JUL-2012                                                             01-01-1995   31-DEC-2030 
          -------------------------------------------------------------------------------------------------------for the second load. first get the query to get the values from all the tables
    mod_time>31-jul-2012 .
    if the code exists then update the existing record with valid_till to 02-jan-2013 i.e yesterday
    and insert new record with the new values and valid from date to 03-jan-2013 i.e today
        --------------------2nd load expected output 
          code    id     type  table1_modtime   table2_modtime      table3.modtime      valid_from     valid_till
          2533                 31-JUL-2012                                                               01-01-1995       02-jan-2013 --updating old record valid-till to yesterday
          2534                 31-JUL-2012                                                               01-01-1995       02-jan-2013  --updating old record valid-till to yesterday
          2533      1     AB   31-JUL-2012        01-SEP-2012        01-SEP-2012         03-jan-2013  31-DEC-2030----updating old record valid-from to today
          2534      1     CD   31-JUL-2012        01-SEP-2012       01-SEP-2012          03-jan-2013  31-DEC-2030--updating old record valid-from to today
          2535                  01-SEP-2012                                                              01-01-1995  31-DEC-2030 --no record exist so insert new record in target table
      Edited by: choti on Jan 3, 2013 5:01 PM

    Hi ,
    Just check the data you have inserted into the tables because, trying to join the table and putting the date constraint its returning no values
    select T1.CODE as code ,t3.id as id ,t2.type as type  ,T1.MOD_TIME as table1_modtime ,T2.MOD_TIME as table2_modtime ,T3.MOD_TIME as table3_modtime from table1 t1, table2 t2,table3 t3 where T1.CODE = t2.code and t2.id = t3.id
    and t1.mod_time<=to_date('31-jul-2012', 'DD-MON-YY')
    and t2.mod_time<=to_date('31-jul-2012', 'DD-MON-YY')
    and t3.mod_time<=to_date('31-jul-2012', 'DD-MON-YY')And this because for the code 2533 and 2534 in the table1 the id entry in the table2 is 1 . but the date entry in the table3 for the Id 1 is 01-SEP-2012 which falls outside the date. Kindly confirm on this data entry in table2.

  • How to import tables to target databse from a remote sql server

    Hi,
    I have various remote database (SQL Server, Oracle).
    I need to replicate those database in staging database and then from that database do a transformation to the datawarehouse database.
    I created a source database and staging database in oracle 9i.
    Using OWB i created a source module and imported all the metadata information from the remote(SQL) database.
    Now i need to import all these stuff to the target database.(just a replica of the remote database in my local machine).
    pls let me know how can i import the stuff into the target database without manually creating it.
    What i am looking for is some sort of scripts where in i can just run them in the target database.
    OR
    is there any other way were i can import the tables and the data into the target module directly?
    when i tried to do this i got an error saying its a invalid oracle source?
    Does this mean that i cannot import the stuff from SQL Server to OWB target module and then deploy to the database??
    pls help me in understanding this?
    TIA
    shankar

    In a nutshell, what you should do is:
    1. Import the source database structure into an SQL Server module or an ODBC source module (depending on whether you are using a transparent gateway or ODBC as a connecting mechanism between SQL Server and Oracle),
    2. Define the target database schema structure in an OWB's target module (in your case, since the source and target module are identica, you can just cut ad paste the source objects into the target module).
    3. Define the mappings (processes that extract data from the source and put them into the target) - in your case these will be straightforward, just 1:1 field mappings, since the source and target databases will have the same structure.
    4. Deploy everything to the target database schema - this will create the target schema objects (tables, views etc.) and install the scripts for data transfer that you designed when you defined the mappings.
    5. Finally, you can run the mappings that will transfer the data from SQL Server to Oracle.
    Regards:
    Igor

  • Issue with characterset setting in OWB flat file target

    an OWB mapping reads from the database source and writes to flat file target in unix os but junk characters are displayed for non english characters in the target file . The database table contains french,spanish,german,arabic characters.The nls db parameter setting is AL32UTF8. The same setting has been applied to OWB target also but still junk values are appearing for non english characterset.different charactersets like al32utf8,utf8,utf18,us7ascii have been tried at owb target setting but nothing is wroking out to remove junk characters. Please suggest
    Edited by: 943807 on 30 Jun, 2012 10:43 PM

    Please provide some input on the issue

  • Urgent.. Characterset of flat file target in OWB

    OWB mapping reads from the database source and writes to flat file target in unix os but junk characters are displayed for non english characters in the target file . The database table contains french,spanish,german,arabic characters.The nls db parameter setting is AL32UTF8. The same setting has been applied to OWB target by editing flat file defintion also but still junk values are appearing for non english characterset.different charactersets like al32utf8,utf8,utf18,us7ascii have been tried at owb target setting but nothing is working out to remove junk characters. Please suggest

    Yes this should be fine. Are you using the gateway to access SQLServer or code template mappings? You need to track which columns are throwing the data type conversion errors.
    Cheers
    David

Maybe you are looking for