Query in odi

Hi,
How to implement this query (select * from tab1 minus select * from tab2 ) in ODI.

Hi,
Sure. :)
1. In your underlying DB for example employee DB run the below query,
create view odi_minus as select * from tab1 minus select * from tab2.
2. Open Designer -> <Your Model where you created the view , i mean logical schema point to employee DB>-> Reverse -> Check View (un check everything and hit APPLY).
Then go to selective reverse tab check selective reverse, new data store, objects to reverse.
3. In the list select the view which u created odi_minus in our case, click on reverse.
4. You will find a view as data store in your model tree, use that as a source in your interface.
Hope it will be clear now.
Thanks,
G

Similar Messages

  • Minus query in ODI 3.4

    hi everyone ,
    can some please explain me how to do minus query in Odi . i am not allowed to create views so please such suggestion.
    in short some method where i can compare two tables and extract only the data that is present in one table and if both have the same data ignore.
    eg .
    table 1
    id desc flag
    100 sdfsd 3
    101 sdfsd 3
    102 sdfds 3
    table 2
    id desc flag
    100 sdfd 8
    103 sdfd 8
    105 dfsdf 8
    result should be
    id desc flag
    100 sdfsd 3
    101 sdfsd 3
    102 sdfds 3
    103 sdfd 8
    105 dfsdf 8
    i .e 8 should not update 3 flag data . in IKM update its lost and if i put update on both id and flag i have two copies . so i just want to compare and load all the date of table 1 completely and then table 2 which doesnt mached with id .
    Please suggest .

    Hi Dev,
    For the situation as you described do something like:
    1) load the firts table with IKM Control Append
    2) Load the second table with the IKM Incremental Update but change the "UPDATE" option to "NO" and use the ID as KEY.
    That will give you exaclty what you wanted because will only load the new records from second and ignore those that already exists in the target.
    Cezar Santos

  • Write the output of a query in ODI to file

    Hi Friends,
    I am using ODI 11g.
    In ODI I want to write the output of the below query to a unix file.
    SELECT 'H'|| rpad('SB9KT.KTPRTO.EBSDATA.D0000000','30',' ')|| rpad(to_char(sysdate, 'YYYYMMDDHHMMSS'), 16, ' ')
    FROM dual;
    Please suggest any inputs.
    Thanks,
    Lony

    lony wrote:
    Hi Friends,
    I am using ODI 11g.
    In ODI I want to write the output of the below query to a unix file.
    SELECT 'H'|| rpad('SB9KT.KTPRTO.EBSDATA.D0000000','30',' ')|| rpad(to_char(sysdate, 'YYYYMMDDHHMMSS'), 16, ' ')
    FROM dual;
    Use OdiSqlUnload tool to write the output of the sql query to a file
    Please suggest any inputs.
    Thanks,
    Lony

  • Target and Source Table - Query from ODI Repository

    Hi folks,
    Can anybody help me? I am trying to query the following from an ODI 11g work repository:
    All tables and for each table the tables that are listed in designer as “filled by” (don’t know the exact translation as I am using a german ODI designer) – in other words “all tables and the tables they are depending on”. The reason is to perform a connect-by query on that.
    There is a solution published on ODIEXPERTS: http://odiexperts.com/interface-mapping-query, but however it does not show me the expected results. Does anyone have an idea how to get a simple table like that:
    TARGET          SOURCE
    TAB1           TAB2
    TAB1           TAB3
    TAB2           TAB4
    TAB3           TAB5
    TAB3           TAB6
    TAB6           TAB7
    Using the Metadata Navigator is no option as we don’t have Weblogic installed and I need the data for further processing.

    If memory serves you have an SNP_POP table still in that release, join to the Model table (the joins cols are obvious if I recall) to get the datastore names and your more or less there.
    I dont have that table in 11.1.1.5 and we moved over a while back so cant really take a look anytime soon.

  • An Urgent Query about ODI

    Hi,
    I have done a scenario which executes sum.sh file.This scenario is successfully executed by OraclediAgent. Now a web service(Let from bpel/soap ui) invokes this agent using agent's wsdl url (like this:-
    http://localhost:8886/oraclediagent/OdiInvoke?wsdl) and then the OraclediAgent execute the scenario. I am successful for this case too.Now my questions are:-
    *1)Is it possible to return the summation result to the invoker web service(bpel/soap ui) through odi.*
    *2)Is it possible to show the o/p(result of the summation) in odi console.*
    and my last question is:
    *3)Every time when the bpel/soap ui invokes OraclediAgent it gets session id as a return.How do I know the execution of the sum.sh file is successfully done or not wrt to invoker.(or more clear to say in weblogic console?)*
    Please ans.It's urgent
    Thanks
    Papai

    hi,
    any update??At least please tell me the reverse procedure i.e i also want to send two number from webservice to the odiOScommand so that the the sum.sh will run successfully where the odiOscommand parameter are variables not a static value.How'ii I do it?
    Please Ans.
    Thanks
    Papai

  • Query On ODI Return

    Hi,     
    I am invoking a shell script from odi with the help of odiOsCommand. The shell script is successfully called.But I need to return a value from shell script to the odi. How to do that ?
    In details:-
    The script is Sum.sh.I pass two variables in the command line.The script is successfully executed but I want to store the "result of the summation" inside a odi variable.How to do it?Please Answer
    Thanks
    Anindya

    Anindya Chatterjee wrote:
    SH wrote:
    You could spool the output into a file and then read it from there in ODIHi,
    My actual requirement is to store the output in a odi variable (without storing the value in database or file(as an intermediate step) and then read it). Is it possible??
    Do not think it is possible directly.
    If not, then you please provide me the code/procedure how to read the file and then store the value in a odi variable
    Refer
    http://odiexperts.com/how-to-refresh-odi-variables-from-file-%E2%80%93-part-1-%E2%80%93-just-one-value/
    Thanks

  • DATE Format Error in ODI-11g(11.1.1.3)

    I am using ETL transformations in ODI-11g. There's a dominant issue regarding date formattings when I map an ODI variable (storing date) with a TGT column(datatype=date) mappings.
    In all the src-tgt mappings I am formatting the date by using TO_DATE() functions. But still getting the error:
    "ORA-01830: date format picture ends before converting entire input string".
    A point to Note: The same ETL in other env are ruuning fine but in my new dev env it's giving this date error.
    I had checked with the DBA folks and they confirmed they set equal DATE settings in all the env.
    The ODI Variable is defined as an "Alphanumeric".
    Tx Used: #BUSINESS_CURRENT_DT=TO_DATE('Date','YYYY-MM-DD')
    Require some urgent advice...Please let me know

    Hi,
    W store name-value pair in the Control table from where we exctract our data. Both (param name and param value) are varchars.
    Well this looks pretty strange in 11g! Here's what we found out...
    If you are trying to retrieve a date variable by using TO_DATE() in the refresh query the ODI Java driver (JDK 1.6) would call java.sql.timestamp and gracefully attach HH:MI:SS.NS along with the date (YYYY-MM-DD HH:MI:SS.NS). My target ia a date always..!
    So, when I do: TO_DATE('20101010','YYYY-MM-DD) in the refresh query ODI stores it as '2010-10-10 00:00:00.0'
    For this the Load always fails as Oracle would not be able to interpret a timestamp by suing TO_DATE()
    The Java driver does this damage. However, it may be wise to store as a timestamp rather as a date if in case u do a Data capture and want the exact time credentials.
    Unfortunately not a req, as of now for us so I had to chop-off the timestamp..!
    Let me know if you find any other details...
    Thanks.!

  • Few Queries in ODI

    Hi ,
    I am very new to ODI so might be the question would sound silly .
    Few Questions:
    1. I want to know if there is any way of hardcoding SQL query in ODI for the source.
    2. I have 4 total interfaces(LoadEmp,LoadCustomer,LoadProd,LoadFact) . I am bundling them in a package. LoadEmp,LoadCustomer and LoadProd are DimensionLoads and LoadFact is fact which depends on Dimensions to be loaded. I want Dimensions to load parallely and finally once the dimensions are loaded the fact should be loaded. Is there a way in Package I can specify this.
    3. I tried to play with Sequences a lot in ODI but was never able to make it hence finally ended up making sequence in Database. I read somewhere a good practise is defining the sequence in Database but if I need to do it in ODI can someone guide me through the method.
    Any inputs on these query would be appreaciated.

    Thanks a lot for your quick response.
    1. I would like to write a simple Select query or a overide query instead of what ODI does . Is it possible ? eg. Select ProductId,ProductDesc from Dim_Product
    2. Can you please let me know how can I have parallel sessions using Scenarios. I tried creating Scenarios for 4 Interfaces LoadEmp, LoadCustomer, LoadProd, LoadFact and tried to embed them in a package but there I had to put "Next Step on success" on every scenarios which means it would run sequential. How can I acheive the same without putting the "Next Step on Success" .What I want to achieve is loading all master together ie LoadEmp, LoadCustomer, LoadProd and fact LoadFact once the Master is loaded hence Masters would be parallel and fact would be sequential.
    3. I am using Oracle as Database . I know I can have sequences created in Oracle and use it in ODI but I wanted to try the sequence part from ODI hence the query. What I am doing is creating a sequence in ODI and when I do the diagram I have tried executing on target and staging . ODI updates the sequence number only once hence my mapping fails since sequence number is a surrogate key .

  • Implementing WITH clause in ODI

    Hi,
    I want to convert certain 'WITH' clauses and 'Inline' views of a SQL query in ODI interfaces.Is there any way I can do this?
    Regards,
    RAshmik

    Hi Rashmik,
    I know that this is an old thread, but did you manage to accomplish this?
    I tried to dig the IKMs and ODI substitution, but from what I understand the "odiRef.getFrom()" method deals with the sources that are marked as subselect, and there is no way to break this subselects away from the "FROM clause" to use them in a "WITH clause".
    Does any one have other thoughts?
    Thanks,
    Murilo

  • Join multiple tables in odi interface

    Hi All,
    I am new member to Oracle to Data integrator. This is a simple question but i haven't figure out.
    I have four source tables and i need to apply joins (left, right and inner)between the table s and use some operators like(and,or) but i am unable to find the this option in odi. I have written a query in SQL Developer and executed it is working fine but when i paste the query in ODI it is showing Missing Expression error.
    Thanks for your help,
    Madhava

    Hi - If you have your four source tables in your interface source your neally there, just drag a column from one table to another to create a join (any columns will do) - Then change the join properties to specify the colum = column and the join type, simple as that.
    You can build your operators either into the joins (e.g AND) or you can create a filter on that column for any predicate , just drag that column from the table onto the canvas to create the filter object, then change the properties of the filter to suit your needs.
    Out of interest - Where are you pasting the query into ODI?

  • Solution Needed for ODI function call

    Hi Experts,
    I am using ODI 11g.
    Currently i am using oracle procedures to call a function in ODI .
    just like "Select package_name.function_name from dual " i am using this query in ODI variables.The output of the function
    i am using in ODI mails .
    So for this ..Suppose for any changes i need to go to the Oracle package and change the function logic...and then promote this
    to production ..which is a time taking for me.
    So i want to write this Function inside ODI variable and send the output to ODI mail ...So that i dont need DB side to promote
    the code to production on every changes.
    Please let me know whether this solution is good or not.
    Thanks,
    Lony

    Hi,
    under my opinion is good having all the logic inside ODI. But it depends from the complexity of the logic and the frequency of your change. If you change the logic once for year it's quite useless make this inside your ODI.
    A good compromise could be to put a package_name.function_name step in your package.

  • Creating a Custom SQL Query

    Hello Folks,
    I am working in a project in Brazil and, we need develop the following load to Hyperion Planning:
    We have the PeopleSoft ERP (MSSQL - relational database) as source.
    Our target is Hyperion Planning.
    The customer has all SQL queries statement written in Hyperion Application Link (HAL), and we need migrate all HAL projects to ODI. In short, I must apply this query as source object and load in Hyperion Planning.
    Follow below the SQL query:
    SELECT RTRIM(ID_CR)AS ID_CR,
    RTRIM(DSC_CR)AS DSC_CR,
    RTRIM(ID_PARENT)AS ID_PARENT,
    '0' EXPENSES,
    '1' INCOME,
    '0'DRE,
    RTRIM(STATUS)AS STATUS
    from DIM_CR where tipo_cr = '1'
    union
    SELECT RTRIM(ID_CR)AS ID_CR,
    RTRIM(DSC_CR)AS DSC_CR,
    RTRIM(ID_PARENT)AS ID_PARENT,
    '1' EXPENSES,
    '0' INCOME,
    '0' DRE,
    RTRIM(STATUS)AS STATUS
    from DIM_CR where tipo_cr = '0'
    I have been written here that it is necessary develop a custom KM to apply a query in ODI. Is it true? Is There another way to solve this issue?
    I have been learned a lot with you. I appreciate a lot your help.
    Wallace Galvão,
    Brazil

    Hi,
    Maybe I am wrong but I wouldn't of thought a procedure would be able to do what is trying to be achieved, with planning you can't just directly insert into and you need to use the IKM to load to it? I would be interested to know if it could easily be done using a procedure. I would of thought the best option to update the KM
    Anyway looking at the query though I am sure it could be achieved without any changes.
    It looks like it is pulling information from one table, which could be reversed and dragged as the source, a filter added on tipo_cr to return 1,0 values
    Then on your staging area you could use some of the inbuilt functions such as CASEWHEN to manipulate the data.
    e.g. when tipo_cr = 1 , expenses column = 1 else it would be 0
    There is also the RTRIM function.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Example of how group by on ODI

    I already post a question on that subject but i didn't succeed to create so if anyone have a example or a tutoriel.
    I explain my case :
    I have a table with a field containing a bank account, another field containing the amount of an operation on this account. I want to make a sum of operations by account. The request will be something like :
    Select SUM(operation),account of TableLedger group by account.
    Thanks.

    Hi,
    If you use the SUM function on the target mapping (operation) then the query that ODI generates will automatically contain a group by.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • ODI 12c Hints

    Hi everyone,
    I am a new baby in Oracle and plus ODI 12c. Shortly my question is about adding hints to ODI. My query is;
    SELECT /*+ full(s) */
             s.sip_date,
             con.seg_behavior,
             s.organization_id,
             SUM (CASE WHEN s.no IS NULL THEN 1 ELSE 0 END) num_cust_without_card,
             COUNT (s.no) num_cust_with_card,
             COUNT (1) num_total_cust,
             COUNT (con.tmv_id) num_cust_with_segcard
    FROM xxmg_siparis s
             LEFT JOIN tmv.contact con ON s.tmv_id = con.tmv_id 
    WHERE s.sip_date >= TRUNC (ADD_MONTHS (SYSDATE, -3), 'mm')
                AND s.status = 5 
    GROUP BY s.sip_date, con.seg_behavior, s.organization_id
    However, the running query in ODI is;
    SELECT
             s.sip_date,
             con.seg_behavior,
             s.organization_id,
             SUM (CASE WHEN s.no IS NULL THEN 1 ELSE 0 END) num_cust_without_card,
             COUNT (s.no) num_cust_with_card,
             COUNT (1) num_total_cust,
             COUNT (con.tmv_id) num_cust_with_segcard
    FROM xxmg_siparis s
             LEFT JOIN tmv.contact con ON s.tmv_id = con.tmv_id 
    WHERE s.sip_date >= TRUNC (ADD_MONTHS (SYSDATE, -3), 'mm')
                AND s.status = 5 
    GROUP BY s.sip_date, con.seg_behavior, s.organization_id
    I want to add  /*+ full(s) */ hint to my query. How can I accomplish it? I searched google a lot, but Please help me.
    Thank you

    I can't attach any file, the buttons are inactive and I don't know the reason. I added full(sip) value to IKM Oracle Incremental update km ORACLE_HINT option. However; in designer tab, sip is in default container. Should I write full(default.sip) or full(sip). Also, under knowledge module tabs (IKM), I added many IKM incremental update modules (for SQL, MSSQL, ORACLE). In this case, which one ODI is uses is determined by the data server connection type? I want to guarantee that, these installed modules does not affect the others operation.
    Here is the output of generated code in simulation mode;
    Generated Session
    Session Name:
    CBS_MUSTERI_DILEK_DS_SESS
    Context Code:
    DEV01
    Step
    Step Name:
    CBS_MUSTERI_DILEK_DS_STEP
    Step No:
    10
    Step Type:
    MAPPING
    Ok Exit:
    0
    Task
    Task Type :
    EX_UNIT_BEGIN
    Task Name 1:
    SERIAL
    Task Name 2:
    MAP_MAIN
    Task
    Task Type :
    EX_UNIT_BEGIN
    Task Name 1:
    SERIAL
    Task Name 2:
    EU
    Task Name 3:
    EBS_APPS_UNIT
    Task
    Task Type :
    EX_UNIT_BEGIN
    Task Name 1:
    Load AMUSTERI_SEGMENT
    Task Name 2:
    IKM Oracle Insert
    Exe Channel:
    JDBC
    Source Logical Schema Name:
    EBS_APPS
    Source Isolation Level:
    DEFAULT
    Target Logical Schema Name:
    EBS_APPS
    Target Connection Name:
    DEV01
    Target Isolation Level:
    DEFAULT
    Target Technology Internal Name:
    ORACLE
    Target Command:
    INSERT /*+  APPEND    PARALLEL  */ INTO APPS.XXCBS_MUSTERI_SEGMENT ( "organization_id" ,  "tarih" ,  "seg_behavior" ,  "seg_kartli_musteri_sayisi" ,  "kartsiz_musteri_sayisi" ,  "kartli_musteri_sayisi" ,  "musteri_top_sayisi" ) SELECT
    (SIP_1.ORGANIZATION_ID) , (SIP_1.SIP_TARIHI) , (CONTACT_1.SEG_BEHAVIOR) , (COUNT(CONTACT_1.TMV_ID)) , (sum(CASE WHEN SIP_1.MUSTERI_KART_NO IS NULL THEN 1 ELSE 0 END)) , (COUNT(SIP_1.MUSTERI_KART_NO)) , count(1)
    FROM ( SELECT
    SIP.SIP_TARIHI SIP_TARIHI , SIP.ORGANIZATION_ID ORGANIZATION_ID , SIP.DURUM_ID DURUM_ID , SIP.MUSTERI_KART_NO MUSTERI_KART_NO , SIP.TMV_ID TMV_ID
    FROM XXMG.XXMG_SIPARIS SIP   WHERE  SIP.SIP_TARIHI >= trunc(add_months(sysdate, -3), 'mm')  AND  SIP.DURUM_ID = 5         ) SIP_1 ,  ( SELECT  FROM TMV.CONTACT CONTACT   WHERE  CONTACT.SEG_BEHAVIOR IN('KAYAN_YILDIZ', 'ALTIN_ISLEM', 'YENI', 'YILDIZ') CONTACT.SEG_BEHAVIOR         ) CONTACT_1   WHERE  SIP_1.TMV_ID = CONTACT_1.TMV_ID
    GROUP BY  (SIP_1.ORGANIZATION_ID),(SIP_1.SIP_TARIHI),(CONTACT_1.SEG_BEHAVIOR)        
    CONTACT.TMV_ID TMV_ID , CONTACT.SEG_BEHAVIOR SEG_BEHAVIOR

  • ODI Join

    Hi,
    I am trying to model the following query in ODI 12c;
    select tarih, h.organization_id, sum(calisan_sayisi) calisan_sayisi
    from hr_all_organization_units h
    left join ( select tarih, paa.organization_id ,count(*) calisan_sayisi
                from per_all_assignments_f paa
                join per_all_people_f pap on pap.person_id= paa.person_id and pap.employee_number not like 'x%'
                join per_person_type_usages_f pu on pu.person_id = pap.person_id
                join per_person_types pt on pu.person_type_id = pt.person_type_id and pt.user_person_type in ('Employee')
                join (select trunc(sysdate) -level tarih from dual connect by level <= 100) t on    t.tarih between nvl(paa.effective_start_date, t.tarih) and nvl(paa.effective_end_date, t.tarih)
                                                                                                and t.tarih between nvl(pu.effective_start_date, t.tarih) and nvl(pu.effective_end_date, t.tarih)
                                                                                                and t.tarih between nvl(pap.effective_start_date, t.tarih) and nvl(pap.effective_end_date, t.tarih)
                where paa.primary_flag = 'Y'
                group by tarih, paa.organization_id) calisan on calisan.organization_id = h.organization_id
    where h.type = 'MAĞAZA'
    group by tarih, h.organization_id;
    I need to join all the result of the left join part to 'hr_all_organization_units' table. However, I do not know how to diffirentiate the source tables. How can I accomplist this? Can you please help me?
    Thank You

    Why I can not add a screenshot to my post Here is what I've done;
        1- I created a reusable mapping;
    It includes the inner left join tables (which are paa, pap, pu, pt and dual table in a dataset)
    Then put an aggregate to group by according to tarih and paa.organization_id (I put the aggregate outside the dataset)
        2- I created a regular mapping;
    When I create a new mapping, it comes with a default source area. In that case;
    I put my hr_all_organization_units table in it
    Then, I drag the created reusable mapping in the target area (because ODI does not allow to put it source area as you say)
    Then, I drag a join component again in the target area
    Then, try to connect default source area and reusable mapping. The result;
    I can connect default source area to join component (when I drag, a line appears between two)
    However, I can not connect it to reusable mapping (reusable mapping and join component does not work!) I really do not understand. Reusable mapping seems as a table but it does not have any columns in it.
    Thank you

Maybe you are looking for

  • Problem in sending online interactive form in email as PDF attachment

    Hi, I am trying to send online intercative forms as PDF attachment once user fills it and click on send button. But this mail i am trying to send from SAP workflow. For this am using one function module which is accepting the pdfsource context attrib

  • Find command syntax to perform an audio conversion

    Hi there, I have to navigate through a tree of directories in which I have some .flac files and for each one I find launch a command to convert them to an iTunes recognized format (around 4000 files and a few hundred directories) possibly in the same

  • Seperate playlist/side playlist

    Hello, I was just wondering if there is (or anyone knows of) something similiar to a playlist editor for winamp for itunes. Party shuffle works pretty well, but it misses a feature which I would really like to have. for instance: you find a cool song

  • Regarding Report Painter

    hi all, i have got a problem in performance of a report painter. i am asked to add a field in the selection screen for a plant so that the performance can improve. its a module pool i guess. i am not able to find the selection screens and all. can an

  • Setting key photo for iWeb photo album

    This one's confusing me a little. I'm trying to select a key photo for my album in iWeb, but it keeps defaulting to the first photo in the album. I would've thought it would be similar to selecting a key photo for an event in iPhoto (i.e. just scroll