Expressions of ODI

Hello
Please suggest some soln for my case here.

my source: oracle table
target: oracle table

all the source columns are mapped to the a target columsn.but column should be responsible under the transformation.

First = SUBSTR (SOURCE. COLUMN, 1, 10)
second = SUBSTR (first, 1, 9)
Third = SUBSTR (second, 1, 8)
Fourth = SUBSTR (third, 1, 7)
Fifth = SUBSTR (Fourth, 1, 6)
Sixth = SUBSTR (fifth, 1, 5)
FINAL = SUBSTR (sixth, 1.4)

in the interface... only one TARGET. FINAL = COLUMN

Since this SQL expressions are very small, I can their club in SQL expression... but this is just an example... my scenario is different with LARG SQL transformations.


Thank you

Published by: user4315565 on November 24, 2009 07:23

Hello

Seems to be huge, but a simple.

To resolve this problem, I would say you write a function in ODI, because they are intended for situations mentioned like the one you mentioned.

In this function, you can either a query oracle (or) use the jython work, according to what seems to be easier for you.

Request written Oracle should be easy for many people.

For the Jython function to perform a task such as you mentioned below, try again with this prototype:

< %="" if(substring(mfgbusentity,2,3)="« Valeur" de="" test »="">< br="">write your instructions here} < br=""> other < br=""> {< br=""> if (V_BILLGBUSENTI = 'An another Test Value' {< br=""> nested If} < br=""> other < br=""> {< br=""> nested instructions else here} < br=""> )} % >

I hope this helps.

Thank you.

Tags: Business Intelligence

Similar Questions

  • Unable to see the function of the technology in the Expression Editor - ODI 11 G

    Hello

    I develop Interface while I am unable to see the technology functions in the Expression Editor where I'm doing a transformation.

    Secondly, in the header, it is show the default language instead of SQL (Oracle)

    any difficulty please...

    Thank you

    KPimage001.png

    I fixed it myself - thank you

    Below, was the step that I did which solved the problem. hope this will help others

    Go to the Studio of ODI

    Develop the language in topology-

    Import new language

    Import mode INSERT_UPDATE synonym

    The definitions of the language of $ODI_HOME/oracledi/xml-reference/LANG_SQL.xml

    Click OK

    Close ODI Studio and open again. that fixed my problem.

    Thank you

  • What is &lt;$ if expression {$&gt; in ODI}

    Hello

    I'm trying to understand the existing logic in an ODI km.

    I see the logic as <$ if expression {$> statement <$} else {$> / * comments * / <$} $>

    at high level, I think, his one "if else" statement. but getting confused on the way including his writings.

    Can someone explain the syntax above please.

    Thank you

    Thanks to David!

    Once you go through the article below, I guess you will have all your answers.

    https://blogs.Oracle.com/dataintegration/entry/odi_11g_dynamic_and_flexible

    Thank you

    Chantal

  • Expression SQL in ODI

    I have the following interface in oracle data integrator

    http://i44.Tinypic.com/2mrsmxt.PNG

    # Run it before you insert the following expression

    ------------------------------------------------

    In the map, I insert the following SQL expression to get the average when the quantity is 0

    ----------------------------------------------------

    AVG)

    WHEN TEST BOX. QUN = 0 THEN

    (SELECT THE TEST. QUN OF TEST

    WHERE TEST1. PRUDU = TEST. PRUDU

    AND TEST1. FLOW = TEST. UNIT

    AND TEST1. UNIT = TEST. UNIT

    AND to_char (TEST.) DATEDDD, "LUN") = to_char (TEST1. DATEDDD, "LUN")

    AND TEST1. DATEDDD! = TEST. DATEDDD

    TEST GROUP. QUN

    )

    ANOTHER TEST. QUN

    END)

    --------------------------------------------------------------

    When I check this expression in ODI...

    # sql expression is correct for this ROW

    --------------------------------------------------------------

    When I run the interface I get this error

    Caused by: java.sql.SQLSyntaxErrorException: ORA-00937: not a function of simple-group

    ----------------------------------------------------------------

    any idea?

    I understand this...

    the problem was the mapping in the field of the staging...

    I changed the source... and it works!

  • How to set a seq.currval in ODI 12 c?

    How can I set the seq.currval in the column of ODI. When I use table.seq.currval in the table is the expression in ODI shows this error java.sql.SQLException: ORA-08002: sequence GL_SEQ. CURRVAL is not yet defined in this session... Can someone help me please?

    Not so much a question of ODI, but an Oracle DB one.

    You must use NEXTVAL on the sequence of initialization CURRVAL in your session - CURRVAL only works after a NEXTVAL

  • Changing Format of column ODI

    Hi all

    I created a mapping (interface) on ODI 12 c. In the area of the source, there is a view (view very huge and important), created in Oracle db. In the target box, my table is in MSSQL Server. Here, the problem is, a column in the view Oracle type does not match the target MSSQL table. Therefore, I must add TRUNC funtion to this column, but I can't change in the actual db. I just have to environment ODI. Is it possible to edit the data coming from the database in ODI? If not, what can I do? Changing the type of column in MSSQL does not work. It does not support a data type for holding such a number;      "70.32782857142857142857142857142857142857'".

    Can you help me?

    Thank you

    Hello

    Yes, you are right, the problem occurred before the truncation or rounding, because we are trying to truncate data to MSSQL that is target and he accepts not the many to MSSQL and the production of the error.

    As an alternative, we can truncate the data only at the level of the source that is Oracle and just pass the data truncated to MSSQL.

    You can use component (tool) "EXPRESSION" of ODI for your purpose, put only to this view oracle column (as well as the types are mismatching) in EXPRESSION and use trunc on or in the EXPRESSION properties, choose 'source' in the ' run on Hint "option.

    But I'm not sure that with this truncation method will be at the level of the source only. Please try it, Hope so it can walk.

    Thank & best regards

    Shiv Kumar

  • Dynamic expression in interface

    Hi all

    Could someone share a way how to create the dynamic expression in ODI interface. For example. I metadata and want to build an expression box on its base and use it in the interface.


    I tried several possibilities:

    (1) Java use in expression mapping program.
    But during the stages of the interface creation getJDBCConnection() method returns NULL for SRC and DEST.
    It is a way to connect to the database?

    (2) generate the expression in the procedure and use it in the interface
    Is there a way how to pass the string interface procedure?

    (3) use variable to generate the expression
    Pure SQL is not enough to generate my expression, I need to cycles, ifs etc.

    (4) use special IKM that replace some symbols of substitution with generated expression.
    Well, if there is no other choice I'll pick this up but don't want to have extra KM special.

    Could someone suggest another solution or workaround for referred?

    Thanks in advance!

    Oleg Ivanov

    Here is the solution

    Step 1. Java ODI procedure
    Create a new procedure in the
    Command on Source - technology - Oracle, and schema-

    Target - technologies - Java Bean shell command and paste the following code

     
    
    <@
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    
    conn=odiRef.getJDBCConnection("SRC");
    Statement stmt=conn.createStatement();
    String result="CASE ";
    char delimiter=(char)13; 
    
    my_query= "select 'WHEN '||SRC_TAB_COLUMN||' = '||SRC_TAB_COLUMN_VALUE||' THEN '''||PRODUCT_NAME||'''' AS OUTPUT FROM ODI_TEMP.metadata";
    ResultSet rs=stmt.executeQuery(my_query);
    while (rs.next()) {
    String  output=rs.getString("OUTPUT")+ delimiter;
    result+=output;
    }
    result+="END";
    
    stmt.close();
    conn.close();
    @>
    

    [Note: Please change the name of the Table, column, as required]
    In the interface where you want to call the condition had the following code

     <@=result@> 
    

    and set it to put in domain.
    I tested the java code and I get after sample case condition

    CASE WHEN Call_Type = 10 THEN 'SMS'
    WHEN Call_Type = 20 THEN 'MMS'
    WHEN Call_Area = -1 THEN 'Unknown'
    END
    

    In the package call first ODI then Interface procedure and run as a set only.
    Hope this fixes your requirement for dynamic business condition.

  • Cannot use analytical functions such as lag/lead in odi components 12 c except in the expression

    Hi I am a beginner of ODI 12 c

    I'm trying to get the last two comments made on the product for a given product id. and load them into a target.

    I have a source table something like

    Product SR_NO comments LAST_UPDATED_TS

    1 good car 2015/05/15 08:30:25

    1 car average 2015/05/15 10:30:25

    Jeep 2 super 2015/05/15 11:30:25

    1 car bad 2015/05/15 11:30:25

    Jeep 2 horrible 2015/05/15 09:30:25

    Jeep 2 excellent 2015/05/15 12:30:25


    I want a target table based on their last timestamp updated as (last two comments)


    SR_NO Comment1 Comment2

    1                             bad                      average

    2 super excellent

    I used the logic below to get records in SQL Developer but in ODI 12 c, I'm not able to do this by mapping a source to the target table by applying analytical functions to the columns in the target table. Can someone help me solve this problem

    SELECT * FROM)

    SELECT SR_NO Comment1, LAG(Comment1,1,) ON Comment2 (SR_NO ORDER BY LAST_UPDATED_TS ASC PARTITION),

    ROW_NUMBER() ON RN (SCORE FROM SR_NO ORDER BY LAST_UPDATED_TS DESC)

    FROM Source_table

    ) M

    WHERE RN = 1

    ;

    UM, I'm afraid that ODI puts the filter too early in the request, if it generates:

    SELECT * FROM)

    SELECT SR_NO Comment1, LAG(Comment1,1,) ON Comment2 (SR_NO ORDER BY LAST_UPDATED_TS ASC PARTITION),

    ROW_NUMBER() ON RN (SCORE FROM SR_NO ORDER BY LAST_UPDATED_TS DESC)

    FROM Source_table

    WHERE RN = 1

    ) M

    ;

    Instead of:

    SELECT * FROM)

    SELECT SR_NO Comment1, LAG(Comment1,1,) ON Comment2 (SR_NO ORDER BY LAST_UPDATED_TS ASC PARTITION),

    ROW_NUMBER() ON RN (SCORE FROM SR_NO ORDER BY LAST_UPDATED_TS DESC)

    FROM Source_table

    ) M

    WHERE RN = 1

    ;

    Even by changing the 'run on Hint"of your component of the expression to get there on the source, the request will stay the same.

    I think the easiest solution for you is to put everything before the filter in a reusable mapping with a signature of output. Then drag this reusable in your mapping as the new source and check the box "subselect enabled."

    Your final mapping should look like this:

    It will be useful.

    Kind regards

    JeromeFr

  • ODI-1228. ORA-00936: lack of expression

    Hi all

    I have an existing map where I load data flatfile Hyperion Essbase 11.

    This is achieved in the 2 interfaces.

    1. 1 flat file, 1 table Oracle to Oracle (staging)

    2. oracle (Staging) to Hyperion Essbase

    I am currently working on interface 1 that has 2 sources: a flat file and an oracle with a join condition table and an oracle target. The change is the addition of 2 new columns. I added 2 new columns in the flat file. I added these 2 columns to the target oracle table also. I changed all the MILES that are:

    1. oracle to SQL file

    2. LKM SQL for Oracle

    3 control of the IKM SQL add - Mindstream - DataQuality - tests

    Diff of the target staging area is not checked.

    Data are not be fulfilled to target oracle table. I get the following error.

    Error: ODI-1228: data_V2 load TXT_ORA 7B (integration) task fails on the target of ORACLE ORA_HYPTEST connection.

    Caused by: java.sql.SQLSyntaxErrorException: ORA-00936: lack of expression

    I tested the connection in the scheme physical and is very well. I am able to see the structure of the table also under the mapping tab with which I think that I am connected to the target.

    Kindly advice.

    Thank you

    Hello

    Can you please open the step failed ODi operator and goto code tab and copy and paste the code into the SQl command prompt and run manually and see the same error message comes or not, if there is error coming on yesy interface map.

    hope this will help you follow the question

    Kind regards
    Phanikanth

  • ODI filter expression editor

    Hello

    I created a filter in ODI, but I can't make an expression in the expression editor. I need to use a statement "Case when" but I get an error "Invalid relational operator.
    I have attached a screenshot: [http://postimage.org/image/brt3u74up/]
    If someone could help or give me a hint, I'd appreciate it.

    Thank you

    Let's not the syntax of your expression. Please try this

    TIP. TIPO_PEDIDO =
    CASE
    WHAT TRICK. CENTRO ('L150', 'L180', 'L358', 'L395', "L151") THEN 'CENTRAL '.
    OTHERWISE "DESCENTRAL".
    end

  • meaning of ODI API odiRef.getFK ("COMPLEX_SQL")

    I want to know what odiRef.getFK("COMPLEX_SQL") value will return.

    What are the condition when this value returns a value?

    Hello

    I think COMPLEX_SQL applies only if the reference (FK) is created from ODI with the type "reference complex user."

    The method will return the contents of the tab "expression" for your reference.

    It will be useful.

    Kind regards

    JeromeFr

  • Import of ODI scenario - syntax error (setting empty for #EDWH.v_company_id).

    When importing the scenario of the ODI, I get the warning message

    Possible reason for failure analyze the above expression is the value of the empty parameter for ' #EDWH.v_company_id '.

    Found variables undefined during treatment: #EDWH.v_company_id

    followed by the error message

    The classifier already contains an item with the same name

    The tool failed with error ERROR_IMPORT code

    My questions: do I have to set the missing variable by using the Javascript API file? If so, are there any samples available?

    Can you the error message and the failure of the import be the consequence of the missing variable?

    Thanks for any suggestions on how to proceed

    Thank you for your response.

    The error was a bug in the ODI old bridge to import.

    By opting for the OEMM 12.2.1.0, which uses straight oracle odi sdk for importation, the problem disappeared.

  • How to remove unwanted characters in ODI Flatfiles

    Hi Experts,

    Can someone please explain, how to remove unwanted characters from flat files before moving on to the target? Your help will be greatly appreciated. Thanks in advance.

    Kind regards

    REDA

    On oracle staged you can use REGEX_REPLACE to get rid of special characters, for example

    REGEXP_REPLACE (, "[^ [: alnum:]" "]', NULL")

    or

    REGEXP_REPLACE (, "[[: cntrl:]] ','") to get rid of nonprinting characters

    In ODI 11.x you would put this in the field of the expression of the target model in your interface

    The ODI 12, you would use a component of the expression in your mapping

  • How to use the Group condition in the ODI mappings

    Hi Experts,

    I have a requirement in the customization of BI applications. Can you please someone explain how to use the LISTAGG function in odi mapping.

    I applied the LISTAGGR function at the level of mapping odi, but I get error below.

    Mapping of ODI: ColumnName: ENAME Expression: LISTAGG (EMP. ENAME, ",") THE GROUP (RANKING BY EMP. ENAME)

    Error:

    ODI-1240: Flow LIST_AGG_FUN_USAGE fails during an operation of integration. This flow of charge table target EMP_BI.

    ODI-1228: task failed LIST_AGG_FUN_USAGE (integration) on the scott_db of ORACLE target connection.

    Caused by: java.sql.SQLSyntaxErrorException: ORA-00937: not a function of simple-group


    Oracle query:

    If I used this sql query in the database the correct result is.

    SELECT DEPTNO, LISTAGG (ENAME, ',') WITHIN THE EMP EMP (ENAME CONTROL) GROUP. DEPTNO;

    Output:

    10CLARK, KING, MILLER
    20ADAMS, FORD, JONES, SCOTT, SMITH
    30ALLEN, JAMES, MARTIN, BLAKE, TURNER, WARD


    Please give your valid solutions, thanks in advance.

    Kind regards

    REDA

    If you try in #ODI12C then in the set of properties, you can select the column which should be used to group by.

    If it's 11g so its bit complicated. Simply replace the mapping with below codes.

    LISTAGG (EMP. ENAME, ",") WITHIN GROUP (ORDER BY ENAME) / * sum() * /.

    Magic!

    Thank you

    Chantal

  • ODI 12 c how to create the table without number (38.0)

    Hi gurus of ODI.

    I got following problem:

    I have a copy 1:1 with the addition of metadata and a delta on the side to find target. When I look into the target in several numeric columns, the values are truncated, I lose precision.

    What ODI research I found the problem to the work table.

    All affected columns are defined as number without giving any precision or scale, in the target as well as the source.

    When I ran the simulation to see what ODI I noticed that, in the creation of the work table statement ODI number is used (38.0) for all numeric columns where no precision is explicitly given.

    It is so clear when ODI loads the data from the source to the working table the values of the numeric columns are truncated.

    My Question now is, how do I know ODI is not to use the number (38.0), but simply of number for the numeric columns with no details given when a work table is created?

    I know I could explicitly give precision and scale for each column of numreic, but it would be a lot of work and for some of the columns the precision required is not known, then that would be the worst Option.

    Thanks for the help

    Martin

    I found myself where was the problem, then I write the answer, while others may find it here:

    The mapping was

    Source--> Filter--> Expression--> Join--> target.

    The join joins anothher Table.

    In the target, the instructions for completing the columns have been Expression.ColumnName

    I changed it to be Source.ColumnName

    The Knowledgemodules delivered with ODI treat different columns depending on how they are.

    In the creation of the work table, firstly everything all computed columns in the Expression or read from the expression by other components, including targets. It then uses the presission and scale in the component expression with number (38.0) by default if it is explicitly given. Items but which are directly read from somewhere before the expression are also saved in the work table, it ODI use the scale and precision holding of the source - and when the Source's number without taking into account the precision and the scale he uses just number.

Maybe you are looking for