This discussion is archived
8 Replies Latest reply: Jul 16, 2013 1:52 AM by DecaXD RSS

ODI KM customization

sabi-in Newbie
Currently Being Moderated

Hi All,

 

I am trying to customize KM of ODI,in new command of existsing KM.

I have putted below query in "Command on Source" tab.

 

SELECT count(1)  CNT

FROM   dual

 

Now trying to use CNT variable in "Command on Target" with below code.

 

<@ int a = #CNT; if (a == 1 )  { out.println('CREATE TABLE') }; @>

 

Getting some error regarding this.

 

Thanks a lot for your help.

 

Regards

Sandeep

  • 1. Re: ODI KM customization
    obiee Newbie
    Currently Being Moderated

    Please post exact error message, so that easily can provide solution/suggestions...


    Based on your post I understood that you are using : symbol rather #, most of time '#' symbol used to calling variable.

     

    <@ int a = :CNT; if (a == 1 )  { out.println('CREATE TABLE') }; @>

    First you may try this in ODI procedure, once you succeed then try in KMs, before customize KM, and duplicate the existing KM to take backup.


  • 2. Re: ODI KM customization
    DecaXD Pro
    Currently Being Moderated

    Hi, this code will work

     

    source code:

     

     

    SELECT DECODE(COUNT(1),1,'"Y"','"N"') CNT

    FROM DUAL

     

    target code:

     

    <@

    String dd = "";

    dd = #CNT;

    if (dd.equals("Y"))

    {@>

    SELECT 'OK' FROM DUAL

    <@}

    else

    {@>

    SELECT 'KO' FROM DUAL

    <@}@>


    as you can see a #CNT is working

     

    if solved remember assign points and close topic :d

  • 3. Re: ODI KM customization
    sabi-in Newbie
    Currently Being Moderated

    Thanks for your reply.

    I was trying to do this condition for below code, trying to execute flow control command conditionaly.

    Somehow it is not working for below code.

    <@

    int dd;

    dd = #CNT;

    if (dd == 0)

    {@>

    <%@ INCLUDE CKM_FLOW DELETE_ERRORS %>

    <@}@>


    Thanks for your help.

    Regards

    Sandeep

  • 4. Re: ODI KM customization
    DecaXD Pro
    Currently Being Moderated

    HI, i haven't an ODI opened BUT i'd try with this code

     

    Source Code:

     

    SELECT DECODE(COUNT(1),1,'"Y"','"N"') CNT

    FROM DUAL

     

    target code:

     

    <@

    String dd = "";

    dd = #CNT;

    if (dd.equals("Y"))

    {@>


    <%@ INCLUDE CKM_FLOW DELETE_ERRORS%>


    <@}@>


    Let me know


  • 5. Re: ODI KM customization
    sabi-in Newbie
    Currently Being Moderated

    I tried but its not working.

    Can you please check and suggest any other way of doing this?

     

    Thanks for your help.

     

    Regards,

    Sandeep

  • 6. Re: ODI KM customization
    DecaXD Pro
    Currently Being Moderated

    Could you write which error are you facing?

  • 7. Re: ODI KM customization
    sabi-in Newbie
    Currently Being Moderated

    BeanShell script error: Sourced file: inline evaluation of: ``out.print("<@ \nint dd; \ndd = #EXE_STATUS;\nif (dd == 0)\n{@>\n") ; @ INCLUDE C . . . '' Token Parsing Error: Lexical error at line 2, column 2.  Encountered: " " (32), after : "@": <at unknown location>
    BSF info: Flow control at line: 0 column: columnNo
    out.print("<@ \nint dd; \ndd = #EXE_STATUS;\nif (dd == 0)\n{@>\n") ;
    @ INCLUDE CKM_FLOW DELETE_ERRORS out.print("\n<@}@>\n\n\n\n\n\n\n\n\n\n\n") ;

     

    ****** ORIGINAL TEXT ******
    <@
    int dd;
    dd = #EXE_STATUS;
    if (dd == 0)
    {@>
    <%@ INCLUDE CKM_FLOW DELETE_ERRORS %>
    <@}@>

  • 8. Re: ODI KM customization
    DecaXD Pro
    Currently Being Moderated

    I've seen you opened a new thread. Please close this

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points