3 Replies Latest reply on Oct 8, 2013 9:15 PM by 996794

    Generate header option as variable



      I have a requirement where I want to use the same interface to write/append a file multiple times based on some conditions.I want to be able to control the Header column generation based on a variable value.

      The Generate Header option in the IKM SQL to File append is a checkbox and it can only be set to True of False. So if I set it to true, it generates header each time the interface is run. Is there a solution for it?




        • 1. Re: Generate header option as variable



          I imagine that you customize the KM so it takes a True / False value for the option instead of this being set by a checkbox, or create another KM option and use that to drive the header creation. Create a copy of the KM before customization and investigate which is the most appropriate approach.

          1 person found this helpful
          • 2. Re: Generate header option as variable

            Hi SH,

            The generate header step is using file technology and following code , with GENERATE_HEADER option checked as yes.


            create header    <%=odiRef.getTargetColList("(", "[COL_NAME]", ",\n\t", ")")%>


            Can you tell me what changes I need to make? I can Make the GENERATE_HEADER option as text (instead of checkbox), but how to use it to drive header creation?




            • 3. Re: Generate header option as variable

              I changed the GENERATE_HEADER option to datatype text and it works partially:

              Here is the code for step:


              <%if(odiRef.getOption("GEN_HEADER").equals("Y")) {%>

              create header     <%=odiRef.getTargetColList("(", "[COL_NAME]", ",\n\t", ")")%>


              <% } %>


              It works perfectly when the value is Y. but fails when the option is set to N, with below error:


              ODI-1228: Task TEST (Integration) fails on the target FILE connection EBS_Export.

              Caused By: java.sql.SQLException: ODI-40480: Malformed INSERT statement.


              The code generated in case of option N is:



              I cant find a way to comment this section. So workaround is to ignore errors on step.

              Any better ideas are welcome!!