ODI Function

I created a function and when I go into the Expression Editor I add it to Mapping Expression, when Irun it the I get the following error,
java.sql.SQLSyntaxErrorException: java.sql.SQLSyntaxErrorException: ORA-00904: "ACCT_MAP": invalid identifier
I tried re-creating the function with a different name.
Suggestions?
Jz

The steps involved in creating an user function in ODI is like this:
1. Create a user defined function in ODI.
2. Go to implementation Tab click on ADD button to add an implementation.
3. In the implementation window specify the technology where the logic would run.
4. If you want the refer to a function defined in a database say oracle then, in linked technologies you will have to check ORACLE and in Syntex section you will have to call the function.
For mapping you will have to refer the name of the odi function against the column being mapped.

Similar Messages

  • Calling ODI Function

    Hi All,
    I need to add the value of 2 source fields ( Source is a file) and based upon that I need to populate the target column value ( target is DB table). For this I have written a PL/SQL function which I am calling in ODI user function , and the desired result is achieved.
    But the thing is , I need to implement this small functionality in ODI itself and not using PL/SQL database functions. The logic can be written in ODI function also but when we call ODI function in mapping it takes the complete logic in the select statement itself. Please let me know where can I write this in ODI to achieve the same.
    Thanks in Advance,
    Regards
    Abhishek Sharma

    OK, so what is wrong with it? That is the functionality of the ODI function, it is a place holder so that you do not have to type same long SQL again and again.

  • ODI function and Planning

    I created an ODI function which is working when I use target as file. But it fails when I use Hyperion Planning. Can ODI function be used when Planning is been used as target. I selected to run that funcation at staging.

    Functions can be used with any of the hyperion technologies though you will need to definitely execute the function on your staging area or source and not on the target, planning has not SQL capibilities.
    What is the error message you are getting, what is the function.
    Cheers
    John
    http://john-goodwin.blogspot.com/

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

  • Exporting Data Of an RDBMS Table to another RDBMS Table using ODI Functions

    Hi,
    I'm facing a problem while Exporting Data Of an RDBMS Table to another RDBMS Table using ODI User Functions.
    Name:- User_Func
    Group:- Training
    Syntax:- User_Func($(SrcField))
    Implementation Syntax:-
    (CASE
    WHEN $(SrcField) > 40000 THEN 'HIGH'
    WHEN $(SrcField) BETWEEN 30000 AND 40000 THEN 'MEDIUM'
    ELSE 'LOW'
    Linked Technology:-Oracle
    To map the GRADE column of my TARGET_EMPTABLE I write
    User_Func(SRC_TABLENAME.SALARY)
    using Expression Editor.
    I got the following error
    ODI-1227: Task ODI_FUNC_INTERFACE (Export) fails on the source ORACLE connection Source_DataServer.
    Caused By: java.sql.SQLSyntaxErrorException: ORA-00905: missing keyword
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:947)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1283)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1441)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3769)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3823)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1671)
         at oracle.odi.query.JDBCTemplate.executeQuery(JDBCTemplate.java:189)
         at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:89)
         at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:1)
         at oracle.odi.runtime.agent.execution.DataMovementTaskExecutionHandler.handleTask(DataMovementTaskExecutionHandler.java:70)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
         at java.lang.Thread.run(Thread.java:619)
    and in code tab it is:-
    select     
         SRC_FUNC_TABLE.E_NUMBER     E_NUMBER,
         SRC_FUNC_TABLE.E_NAME     E_NAME,
         SRC_FUNC_TABLE.E_LOC     E_LOC,
         (CASE
    WHEN SRC_FUNC_TABLE.E_SAL > 40000 THEN 'HIGH'
    WHEN SRC_FUNC_TABLE.E_SAL BETWEEN 30000 AND 40000 THEN 'MEDIUM'
    ELSE 'LOW'
    )     E_GRADE
    from     SOURCE_SCHEMA.SRC_FUNC_TABLE SRC_FUNC_TABLE
    where     (1=1)
    Please Help

    Anindya Chatterjee wrote:
    Hi,
    I'm facing a problem while Exporting Data Of an RDBMS Table to another RDBMS Table using ODI User Functions.
    Name:- User_Func
    Group:- Training
    Syntax:- User_Func($(SrcField))
    Implementation Syntax:-
    (CASE
    WHEN $(SrcField) > 40000 THEN 'HIGH'
    WHEN $(SrcField) BETWEEN 30000 AND 40000 THEN 'MEDIUM'
    ELSE 'LOW'
    )Your CASE statement syntax is not correct
    It is missing an END key word
    It should be
    (CASE
    WHEN $(SrcField) > 40000 THEN 'HIGH'
    WHEN $(SrcField) BETWEEN 30000 AND 40000 THEN 'MEDIUM'
    ELSE 'LOW'
    END )
    Linked Technology:-Oracle
    To map the GRADE column of my TARGET_EMPTABLE I write
    User_Func(SRC_TABLENAME.SALARY)
    using Expression Editor.
    I got the following error
    ODI-1227: Task ODI_FUNC_INTERFACE (Export) fails on the source ORACLE connection Source_DataServer.
    Caused By: java.sql.SQLSyntaxErrorException: ORA-00905: missing keyword
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:462)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:931)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:481)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:205)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:548)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:947)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1283)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1441)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3769)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3823)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1671)
         at oracle.odi.query.JDBCTemplate.executeQuery(JDBCTemplate.java:189)
         at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:89)
         at oracle.odi.runtime.agent.execution.sql.SQLDataProvider.readData(SQLDataProvider.java:1)
         at oracle.odi.runtime.agent.execution.DataMovementTaskExecutionHandler.handleTask(DataMovementTaskExecutionHandler.java:70)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
         at java.lang.Thread.run(Thread.java:619)
    and in code tab it is:-
    select     
         SRC_FUNC_TABLE.E_NUMBER     E_NUMBER,
         SRC_FUNC_TABLE.E_NAME     E_NAME,
         SRC_FUNC_TABLE.E_LOC     E_LOC,
         (CASE
    WHEN SRC_FUNC_TABLE.E_SAL > 40000 THEN 'HIGH'
    WHEN SRC_FUNC_TABLE.E_SAL BETWEEN 30000 AND 40000 THEN 'MEDIUM'
    ELSE 'LOW'
    )     E_GRADE
    from     SOURCE_SCHEMA.SRC_FUNC_TABLE SRC_FUNC_TABLE
    where     (1=1)
    Please Help

  • Pass constant values to ODI functions in interface mapping

    I have a generic ODI user function
    Populate_TRG_COLS($(in1), $(in1Val), $(in2), $(in2Val), $(in3))
    Implementation (ORACLE):
    CASE
    WHEN $(in1)=$(inVal1) AND $(in2)=$(inVal2)
    THEN $(in3)
    END
    I use this function when mapping my target columns at
    say TRG_COL_1 maps to
    Populate_TRG_COLS(SRC_COL_A, '1.0' ,SRC_COL_B, '310.0' , SRC_COL_C);
    say TRG_COL_2 maps to
    Populate_TRG_COLS(SRC_COL_A, '2.0' ,SRC_COL_B, '320.0' , SRC_COL_C);
    and so on.
    But its throwing error (invalid character/identifier).
    I have tried all possible ways to express these constants say
    using TO_CHAR(1.0) or "1.0" or TO_CHAR('1.0')
    But none works, plz help.

    No idea why and how it worked I just changed
    Populate_TRG_COLS($(in1), $, $(in2), $, $(in3))
    Implementation (ORACLE):
    CASE
    WHEN $(in1)=$ AND $(in2)=$
    THEN $(in3)
    END
    This is working and taking correct passed values at correct places.
    Can any one validate whether this is the solution.
    I use this function when mapping my target columns at
    say TRG_COL_1 maps to
    Populate_TRG_COLS(SRC_COL_A, 1.0 ,SRC_COL_B, 310.0 , SRC_COL_C);
    say TRG_COL_2 maps to
    Populate_TRG_COLS(SRC_COL_A, 2.0 ,SRC_COL_B, 320.0 , SRC_COL_C);
    Values passed are numeric.

  • How to use pl/sql code as ODI user defined function

    Hi All,
    i have a pl/sql code and i want to create ODI user defined function using this code .
    please find the pl/sql code below:
    ============================
    declare
    v_no_of_duplicate_rec number := 0;
    begin
    select count(*)
    into v_no_of_duplicate_rec
    from ( select 1
    from temp_pre_selections
    group by svb_number, selection_id
    having count(*) > 1);
    if v_no_of_duplicate_rec = 0 then
    return 'N';
    else
    return 'Y';
    end if;
    end if;
    ==========================
    please help me how to achieve the same .
    Thanks
    Vinod

    2 ways:
    a. implement logic in odi function directly: getCount, Oracle implementation:
    select case count(1) when 0 then 'N' else 'Y' end
    from hr.employees
    when you use this function to refresh a variable, the refresh statement should only be getCount, you shoueld not write select getCount from dual, otherwise it will become
    select select .... from ... from dual
    b. if your logic is complex, I suggest to write function directly in your database, then call this function in your ODI function
    eg:
    CREATE OR REPLACE FUNCTION hr.test RETURN varchar2 IS
    tmpVar NUMBER;
    BEGIN
    select count(1) into tmpVar from hr.employees;
    if tmpVar=0 then
    return 'N';
    else
    return 'Y';
    end if;
    END test;
    then create a ODI function, Oracle implementation is
    hr.test
    in your variable refresh statement, you can write select getCount from dual
    if you use the odi function in other locations expect for refreshing variable, the idea is similar

  • Problem while using a user function

    Hi,
    I just want to learn how a user function in ODI works.
    I have created a user function(for Oracle technology).
    In Definition Tab, I gave bfun($(branchc))
    In implementation I gave
    if ($(branchc) = 'it' || 'cse') then
    return('IT')
    else
    return('Non-IT')
    end if
    In a mapping rule i am using it as BFUN(STUDENT.BRANCH)
    I am getting the following error...
    Bad Query: ORA-00904: "BFUN": Invalid Identifier
    select BFUN('STUDENT.BRANCH') from EX.STUDENT STUDENT where (1=2).
    EX is my source schema.
    Please help me in resolving this.

    Hi,
    That is a common error on ODI.
    The ODI function, (as ODI variable) is to "substitute words", it means, ODI is a code generator and a function are made to substitute code, not to "execute" that action coded.
    For instance: If there are a "case when" instruction that is necessary be typed over and over again, at several places just change the column to be evaluate, you can create a ODI function to substitute this code avoiding type it several times and better, let the same code in just one place.
    Is a way to have “Object Orientation” coding (OO) to code generation...
    Does it make any sense to you?
    Cezar Santos

  • Packages in odi

    hi friends..
    I am very new to ODI.
    Can any one please tell me how to work with packages and what is its function and how packages work???
    soumya.

    Hi Soumya,
    Packages is the area,where we can use all objects like Interfaces,Variables and Procedures.By using these objects we can achieve the output.we cant get the results everytime, by using interface alone. So, by using package, we can execute the steps in sequential process as well as parellel process.If you open the package or create the package, you can find so many odi functions also which you can use for you r development.
    refer
    http://odiexperts.com
    Regards,
    Sri.

  • Function to get Package Name

    Is there an ODI function that I can call in a package step that will return the name of the current running Package?
    Thanks in Advance,
    Kevin

    Hi,
    Unfortunatelly not, unless a access to the work rep is done..
    An option is send the value (parant scenario name) to the child scenario as parameter.
    Make sense?

  • How to export data using application adapter for EBS?

    my scenario is : there're some external apps need to communicate with EBS,
    and the intermedia layer supposed to be implemented by SOA suite/Fusion adapters.
    my confusion is:
    in oracle integration repository, most of APIs are CUD (create, update, delete) without R (read). but many of our usecase was querying data from EBS.
    my question is : although, considering performance and unpridictable query object and granularity,it's not a good idea using app adatper to querying data from EBS via app api, but if I using db adapter to query data directly, it seems not easy as expected because it need to know the detail table structure and relationship and to build sql by hand.
    so, is there other proper way to get outbound data integration using fusion middleware? additional, I'm not clear about the ODI functionality , is it possible and easy to use ODI perform this task, eg, is ODI has enough API to interact with fusion adapter?

    In the Adapter Wizard look under "Other Interfaces/Custom Objects/PLSQL APIs". There are many many "Get" APIs here. None of these are identified or explained in the Integration Repository but the Trading Community Architecture - Technical Implementation Guide does give a little bit of information about what they do.

  • Write to a file using a system variable in the path

    I got an error when I used the following command to write a file
    OdiOutFile "-FILE=<%=System.getProperty("LOG")%>\test.log" -APPEND "-CHARSET_ENCODING=ISO8859_1" "-XROW_SEP=0D0A"
    The "LOG' is an environment variable.
    The error is
    java.lang.Exception: Oracle Data Integrator Function does not exist
    It looks like ODI treat System.getProperty as ODI function instead of java method. I use SUNOPSIS API as technology in the command

    At this moment I can't give a source code example because I'm writing it :) and I'm trying to see the cases where I may have some problems.
    But my idea is to access the file at any time and to write into it with differenent threads in a differenet places in this file. In fact the problem I'm trying to solve is :
    I have a objects called Data that are generated by some other thread independent of my application. This thread puts the Data objects in some kind if buffer. When the buffer is full, I'm creating a few threads fo every object Data in this buffer (the data objects in its own is some collection of floats and doubles) So I'm trying to position the new created threads over the file but in different places and then make them write the data collected in the object Data.
    To position de threads over the file, I'm accessing it by some synchronous method to undestand where it can write in this file and the writing is not synchronous because I'm trying to calculate the exact place and number of bytes of writing and in this way to avoid (may be) the eventuality of errors.
    Regards,
    Anton

  • Understanding variables

    We had an ODI developer that setup a complete logging framework for ODI, custom application and PLSQL packages. The developer is no longer with our company and I have been tasks with supporting his work. I won't explain the entire logging framework as it is complex, but I will explain enough to hopefully help understand my problem.
    Basically, for each project, he setup 3 project variables as:
    1. V_Job_Name - holds a static value used to lookup the name of the job on the Oracle Logging schema
    2. N_Job_Run_ID - a number supplied by the logging framework that is passed along all steps in the package. This basically value is passed back to the logging framework with each "log message"
    3. N_Run_Step_ID - similare to N_Job_Run_ID, except for each individual step.
    This framework has worked flawlessly until I decide to add a second Package to an existing Project. Now I have two Packages that are using the same variables and when I set the static value of V_Job_Name in Package 1 and I open Package 2, the value is persisted to the second package. The inverse of this happens as well. It appears to me that each package actually shares one instance of the variable instead of each having its own copy.
    I need to find a way for each Package to set its own default value for the V_Job_Name as each package represents a different job.  Is this possible and am I using the variables wrong?
    I could actually get around this if there was a function that I could call in a step that would return the name of the current running Package, but when I asked this in another thread, I was told it was not possible.
    Thanks,
    Kevin

    Hi Kevin,
    It is possible to have the name of current package, just use the ODI function: <%=odiRef.getSession("SESS_NAME")%>
    If that work doesn't work for you, we can figure out something to solve your problem... Don't worry, always there is a solution!

  • How to know what errors was with a step?

    From odi repository, it get the step 'p_convert_ods_targets' got errors. (step 'p_convert_ods_targets' is a procedure)
    SQL> select step_name,nb_row,nb_err from snp_step_report
      2  where step_name='p_convert_ods_targets';
    STEP_NAME                          NB_ROW     NB_ERR
    p_convert_ods_targets                   2          2How could I know what errors was these?
    Any help will be appreciated!!!
    Best wishes,
    Satine

    I dont think you can extract any more information from this.
    These entries in this table are made by a scenarios that is compiled from a procedure. This procedure would contain some steps with Jython commands like
    <%=snpRef.setNbRows(2) %>
    <%=snpRef.setNbErrors(2) %>
    So, its just a variable that is being passed to the above odi functions and these values are being recorded in NB_ROW and NB_ERR columns.
    You will need to look at the code of the procedure to find out whats going on.

  • Oracle Warehouse Builder dies or is no longer supported?

    Hello,
    I've heard that the Oracle Warehouse Builder eventually no longer be supported or eventually die out. Can anyone possibly tell already from a date when it will be like this?
    I look forward to your answers

    The guidance we received from Oracle is 11.2 is the final OWB release. Patchsets will be provided thru the 11.2 database premier support period and OWB 11.2 will remain certified/supported thru the database 12c release. OWB basic functionality will still be included in 12c license as best I understand (it was not clear if patchsets would continue after 11.2 premier support ends in Jan 2015). The statement of direction has been for migration of OWB and ODI functionality into a merged product line.
    <opinion>
    My guess would be Oracle is prepping DB 12c and next ODI for release later this year and will include some kind of built-in basic ETL along the lines of OWB 11.2 in the DB and the ODI release would include some migration or interoperability to bridge the OWB/ODI repositories. I have not heard anything on this, just surmising from past history of when DB releases are announced and related functionality.
    </opinion>

Maybe you are looking for