Assign value to ODI variable from Jython

Hello Experts,
I have a procedure where I'm using Jython code. I want to assign a value to an ODI project variable from a Jython function:
Example:
#COUNTER = len(v_jythonList) ---> being #COUNTER the ODI project variable and len() the jython function
Now, i noticed that using ODI variables adds # sign which is use for comments in Jython code. Is there a way to assign values to ODI variables from Jython script?
Please help!.
Thanks.
Pablo.

Hi,
Does this post help you :- How to assign value for a ODI variable from Jython Script
Doc id 424579.1 on metalink should help.
Cheers
John
http://john-goodwin.blogspot.com/

Similar Messages

  • Can we assign jython variable value into ODI variable?

    Hi Team,
    We are trying to save jython variable value into ODI variable so that ODI variable can use in later steps.
    we are facing failure regards same.
    Please suggest us so that we can use ODI variable value in later steps.
    Thanks
    Ankush.

    See if this post help you :- How to assign value for a ODI variable from Jython Script
    Doc id 424579.1 on metalink should help.

  • How to assign a value to ODI Variable using ODI Procedure

    Hi ,
    Is it possible to assign a value to a ODI Variable using ODI Procedure ?
    If it is possible how we can do that.
    BEGIN
    IF #Counter=1
    Then
    #Next_Increment:=#Counter+1;
    End if;
    END;
    In my example I have 2 ODI Variables #counter and #Next_increment.
    I am trying to assign VALUE TO A ODI VARIABLE #next_increment from another ODI Variable #counter.
    thanks
    prasanna

    Prasanna,
    I have a similar requirement where I need to assign values to ODI variables within a procedure. How do we make use of an ODI package to accomplish this ?
    Actually, I have a sequence of ODI steps, and there is a call to a procedure 'LOG ERROR' from every step which gets called in case error occurs in any step. I just need to identify from which step the error came.
    Please help.

  • How to refresh ODI variables from file

    Hi,
    I followed the fillowing links to implement the dynamic file parameter passing in to the resource name of a datastore.
    part-1. http://odiexperts.com/how-to-refresh-odi-variables-from-file-%E2%80%93-part-1-%E2%80%93-just-one-value
    part-2. http://odiexperts.com/how-to-refresh-odi-variables-from-file-%e2%80%93-part-2-%e2%80%93-getting-all-lines-once-at-time
    For me first part is working fine where as in second part i made canvas looks like
    Vlinevariable(refreshing variable)------------------dyanamicfile(refereshing variable)--------------------- interface.
    Interface looks like Flatfile to db ,km's are lkm file------sql and ikm is sql incremental update
    Vlinevariable is working fine where i am getting numbers in sequence manner to assign in to code of dynamicfile variable and in dynamicfile is not taking that value in to that code and causing session failed.
    The code which i put in a refreshing code of dynamicfile is followed below
    select     samplefile1_csv     C1_SAMPLEFILE1_CSV
    from      TABLE
    /*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=code_generationSNP$CRLOAD_FILE=C:\file/my_test_file.txtSNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=0x0009SNP$CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=1SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=samplefile1_csvSNP$CRTYPE_NAME=STRINGSNP$CRORDER=1SNP$CRLENGTH=50SNP$CRPRECISION=50SNP$CRACTION_ON_ERROR=0SNP$CR$$SNPS_END_KEY*/
    For the firstrow the number has to get from vlinevariable where in my case not working .
    In session while loading the interface (load data) i am getting error like
    message-------------- ODI-1227: Task SrcSet0 (Loading) fails on the source FILE connection file_tgt.
    Caused By: java.sql.SQLException: File not found: C:\file/
         at com.sunopsis.jdbc.driver.file.FileResultSet.<init>(FileResultSet.java:160)
         at com.sunopsis.jdbc.driver.file.impl.commands.CommandSelect.execute(CommandSelect.java:57)
         at com.sunopsis.jdbc.driver.file.CommandExecutor.executeCommand(CommandExecutor.java:33)
         at com.sunopsis.jdbc.driver.file.FilePreparedStatement.executeQuery(FilePreparedStatement.java:131)
         at com.sunopsis.sql.SnpsQuery.executeQuery(SnpsQuery.java:602)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeQuery(SnpSessTaskSql.java:3078)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java:571)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java:2815)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2515)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:534)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:449)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1954)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:322)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:246)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:237)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:794)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:114)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
         at java.lang.Thread.run(Thread.java:619)
    source code is select     a     C1_A,
         b     C2_B
    from      TABLE
    /*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=sample1SNP$CRLOAD_FILE=C:\file/#PROJECT1.FILENAMESNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=0x002cSNP$CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=1SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=aSNP$CRTYPE_NAME=NUMERICSNP$CRORDER=1SNP$CRLENGTH=50SNP$CRPRECISION=12SNP$CRACTION_ON_ERROR=0SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=bSNP$CRTYPE_NAME=NUMERICSNP$CRORDER=2SNP$CRLENGTH=50SNP$CRPRECISION=12SNP$CRACTION_ON_ERROR=0SNP$CR$$SNPS_END_KEY*/
    target code insert into STAGING.C$_0SAMPLE1
         C1_A,
         C2_B
    values
         :C1_A,
         :C2_B
    KIndly help me and thanks in advance.

    ODI is complaning it cannot locate the file. Try replacing the '/' character with a '\' after file in the designated filepath.

  • How to use ODI Variables in Jython

    Hi, im doing a dynamic interfaz .. so i make a connection to bd.
    When i try to do it .. i got an error...
    How can i access to the odi variables from odi..
    this is my code ..
    <%
    import java.sql.*;
    import java.io.*;
    BufferedWriter bw = new BufferedWriter(new FileWriter("c:\log.txt"));
    StringBuilder strB = new StringBuilder();
    Class.forName("oracle.jdbc.driver.OracleDriver");
    String ip = "#PROJECT.IP";
    String url = "jdbc:oracle:thin:@"+ip+":1521:orcl";
    Connection con = DriverManager.getConnection(url,"snpw","admin");
    stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
         bw.write(" raise(' ");
         out.print(" raise(' ");
    String str = "SELECT c.var_name,d.project_name FROM snp_package a JOIN snp_step b On (a.i_package = b.i_package) JOIN snp_var c ON (b.i_var = c.i_var) JOIN snp_project d ON (c.i_project = d.i_project) WHERE UPPER(pack_name) = upper('DebugJava')";
    ResultSet rs = stmt.executeQuery(str);
    while(rs.next()){
    String var_name = rs.getString("var_name");
    String project_name = rs.getString("project_name");
    out.print(var_name+" #" project_name"."+var_name+"\n ");
    bw.write("#STUFF."+var_name);
    bw.write("')");
    out.print("')");
    rs.close();
    bw.close();
    stmt.close();
    con.close();
    %>
    this is the error ...:
    The application script threw an exception: java.sql.SQLException: Excepción de E/S: The Network Adapter could not establish the connection BSF info: DebugVariables at line: 0 column: columnNo
    Iknow tha is taking "#PROJECT.IP" like my ip .. but there is a variable that is on my package with a assiged value 127.0.0.1
    but jython is not taking it !!
    I make a raise to the variable .. and yes the variable take de value "127.0.0.1" but not in my jython code
    note: My variable is linked with OK to the jython procedure on my package
    Can i acces to the variable? from jython how?.
    Thanks in advanced!!
    Edited by: user11334562 on 28-abr-2010 15:12

    1. This is not a jython code, this is beanshell code. Anything you put between <% and %> is beanshell code which is sort of a parser code for ODI. Check out
    http://www.beanshell.org/
    2. Your expression for "url" variable is wrong. If you want to concatenate strings, you have to use + sign i.e it should be:
    String url = "jdbc:oracle:thin:@"+ip+":1521:orcl";
    Other statments need to be adjusted similar way.
    3. Why would you want to go through so many trouble? Just extract the SQL into a file using ODI SQLUnload tool. The sql should be:
    SELECT c.var_name||' #'||d.project_name||'.'||c.var_name FROM snp_package a JOIN snp_step b On (a.i_package = b.i_package) JOIN snp_var c ON (b.i_var = c.i_var) JOIN snp_project d ON (c.i_project = d.i_project) WHERE UPPER(pack_name) = upper('DebugJava')
    4. How does printing a set of variables from a particular package help you to write dynamic interface?

  • Can we assign value to a variable in PL/SQL Loop

    Hi
    Can we assign value to a variable in PL/SQL Loops?
    DECLARE
    V_Num NUMBER;
    BEGIN
    LOOP
    V_Num := 10;
    DBMS_OUTPUT.put_line(V_num);
    V_Num := V_Num - 1;
    EXIT WHEN V_Num = 0;
    END LOOP;
    END;
    In the above program, Can we assign V_num with a value 10????????
    Thanks & Regards,
    Hari Babu
    Edited by: 1004977 on Jun 5, 2013 2:40 AM

    Hi,
    1004977 wrote:
    Hi
    Can we assign value to a variable in PL/SQL Loops?
    DECLARE
    V_Num NUMBER;
    BEGIN
    LOOP
    V_Num := 10;
    DBMS_OUTPUT.put_line(V_num);
    V_Num := V_Num - 1;
    EXIT WHEN V_Num = 0;
    END LOOP;
    END;
    In the above program, Can we assign V_num with a value 10????????Yes; the example you posted does that.
    When the loop starts, the value 10 is assigned to v_num. You should see that value displayed by the put_line statement.
    After that, v_num is set to 10 - 1 = 9.
    Next, the EXIT condition is evaluated. At this point, v_num is 9, not 0, so the loop runs again. V_num is set to 10 again, and the loop continues forever (or, in some versions, until the dbms_output buffer is filled and an error occurs.)

  • Assigning value to a variable.

    i have one doubt.
    we can assign value to a variable either in declaration section or in exectuion section.
    so please explain when and wherer should we assign value to a variable.
    thank you very much.

    I think the best way to look at it is...
    If you don't want your variable(s) to have default values that are NULL, assign a value in the declaration section, otherwise assign it where you feel like.
    If you take an example of:
    declare
      v_sum number := 0; -- default variable to 0
      cursor cur_test is
    begin
      for i in cur_test
      loop
        v_sum := 0; -- set variable to 0 before the loop
        loop
          exit when .. some condition ..
          v_sum := v_sum + ..
        end loop;
      end loop;
    end;
    /.. we have a need to set the variable v_sum to 0 before each iteration of the internal loop, so there's little point in having it defaulted to 0 in the declaration section, hence I wouldn't typically default it there and would typically have the code as..
    declare
      v_sum number; -- no point in defaulting it
      cursor cur_test is
    begin
      for i in cur_test
      loop
        v_sum := 0; -- set variable to 0 before the loop
        loop
          exit when .. some condition ..
          v_sum := v_sum + ..
        end loop;
      end loop;
    end;
    /It all depends on what you're doing and what seems the most logical or preferred option.
    Defaulting values in the declaration section can let you see clearly what the starting values are for things, but only if you really need to do it.

  • Assigning long text values to ODI variable

    Hi all,
    I want to store the error message of the previous step in a variable: _<%=odiRef.getPrevStepLog("MESSAGE")%>_ (using ODI 10.1.3.5 on Oracle 9i).
    If I refresh the variable using a statement like Select '<%=odiRef.getPrevStepLog("MESSAGE")%>' From dual , it errors out if the message has more than 4K characters.
    I tried to use _<%=odiRef.getPrevStepLog("MESSAGE").substring(0,3999)%>_ , but this creates an indexoutofbounds exception if the message has less than 4K characters.
    I tried to use assign instead of refresh, but it only prints the jython code instead of retrieving the variable. How can I assign the message to a variable?
    Thanks,
    Matt

    Cezar,
    Here's the operator information. Oracle DB version is 10g EE, Rel. 10.2.0.4.0 - 64bit
    Operator - Description
    select substr('org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 23, in ?
    com.hyperion.odi.essbase.ODIEssbaseException: Cannot build dimension. Analytic Server Error(1090004): Unable To Open File [hypxx/product/essbase/AnalyticServices/app/xxx_PL/xxx_PL/ActCalce.rul]
         at com.hyperion.odi.essbase.ODIEssbaseMetaWriter.loadData(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
         at org.python.core.PyMethod.__call__(PyMethod.java)
         at org.python.core.PyObject.__call__(PyObject.java)
         at org.python.core.PyInstance.invoke(PyInstance.java)
         at org.python.pycode._pyx9.f$0(<string>:23)
         at org.python.pycode._pyx9.call_function(<string>)
         at org.python.core.PyTableCode.call(PyTableCode.java)
         at org.python.core.PyCode.call(PyCode.java)
         at org.python.core.Py.runCode(Py.java)
         at org.python.core.Py.exec(Py.java)
         at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:144)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: com.essbase.api.base.EssException: Cannot build dimension. Analytic Server Error(1090004): Unable To Open File [hypxx/product/essbase/AnalyticServices/app/xxx_PL/xxx_PL/ActCalce.rul]
         at com.essbase.server.framework.EssOrbPluginDirect.ex_olap(Unknown Source)
         at com.essbase.server.framework.EssOrbPluginDirect.essMainBuildDimension(Unknown Source)
         at com.essbase.api.session.EssOrbPlugin._invokeMainMethod(Unknown Source)
         at com.essbase.api.session.EssOrbPlugin._invokeMethod2(Unknown Source)
         at com.essbase.api.session.EssOrbPlugin._invokeMethod(Unknown Source)
         at com.essbase.server.framework.EssOrbPluginDirect._invokeProtected(Unknown Source)
         at com.essbase.api.session.EssOrbPluginEmbedded.invokeMethod(Unknown Source)
         at com.essbase.api.session.EssOrbPluginEmbedded.invokeMethod(Unknown Source)
         at com.essbase.api.session.EssOrbPlugin.essMainBuildDimension(Unknown Source)
         at com.essbase.api.datasource.EssCube.buildDimension(Unknown Source)
         at com.hyperion.odi.essbase.wrapper.EssbaseApplication.buildDimension(Unknown Source)
         ... 32 more
    com.hyperion.odi.essbase.ODIEssbaseException: com.hyperion.odi.essbase.ODIEssbaseException: Cannot build dimension. Analytic Server Error(1090004): Unable To Open File [hypxx/product/essbase/AnalyticServices/app/xxx_PL/xxx_PL/ActCalce.rul]
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:595)
    ', 1, 4000) from dual
    Operator - Execution:
    1704 : 42000 : java.sql.SQLException: ORA-01704: string literal too long
    java.sql.SQLException: ORA-01704: string literal too long
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:503)
         at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:965)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:535)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1051)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3026)
         at com.sunopsis.sql.SnpsQuery.executeQuery(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlV.execStdOrders(SnpSessTaskSqlV.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlV.treatTaskTrt(SnpSessTaskSqlV.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlV.treatTask(SnpSessTaskSqlV.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:595)

  • How do I assign an ODI variable from an Open Tool?

    I'm writing an open tool (a custom tool to use in my ODI flows - a java class that implements oracle.odi.sdk.opentools.IOpenTool
    ). I need to perform a complex calculating in the java Open Tool and 'export' a value back into the ODI world. Idealy, it would be great if I could set a variable in ODI (from within the java world).
    Is this possible?
    If anyone knows the answer, or another way to do this (that might not be as ideal, but works all the same) please let me know.
    Matt.

    Matt
    It is not possible to directly populate an ODI variable, but what you can do is to put the result value into a memory engine table/column, and then to refresh the variable from there. As it is all in-memory, it is fast.
    Craig

  • Assigning value to a variable in Script Component.

    I'm pretty new to SSIS development and need to figure out a problem with assigning a value to a user defined variable. I created a pretty simple package. It reads a flat file, extracts date from a header record and subsequently uses derived column component
    to reformat data to the desired output format. One of the columns (FileRunDate,
    string, length 8) in the derived component is defined as a string and in the expression I'm assigning it to a variable I set earlier in the script component -
    @[User::vRunTimeDate]. When the process runs, the output file gets generated, however FileRunDate reflects
    originally set varible's value. It seems that the variable assignment in the script task does not work, even though in the debug mode, I do see how the value is being set. The variable has an attribute of ReadWrite. Is it due to the fact that the value is
    being set in the same workflow?
    Any feedback is greatly appriciated.

    Unfortunately I'm unable to add a screenshot of the process, for some reason I get an error message when I try to do that. In a nutshell the entire workflow consist of flat file source component, following by a script component (this is where I read and
    assign the variable) 
        public override void PostExecute()
            IDTSVariables100 vars;
            base.PostExecute();
            // Set run date
            if (strRunDate != null)
                VariableDispenser variableDispenser = (VariableDispenser)this.VariableDispenser;
                variableDispenser.LockForWrite("User::vRunTimeDate");
                variableDispenser.GetVariables(out vars);
                // Set the variable
                vars["User::vRunTimeDate"].Value = strRunDate;
                //Unlock the variable 
                vars.Unlock();
                //Variables.vRunTimeDate = strRunDate;
    then goes conditional split ( filtering out unwanted records), which is connected to a derived column component (this is where one of the columns get assigned a variable's value), one more script component (this where I identify
    specific data element and do a replace command) and finally flat file destination.
    BTW, the article in the provided URL clearly states that variable won't reflect assigned value till the entire workflow has finished. If that's the case, then I think I know my
    answer. Is there is such a thing as putting execution of different steps in a different step, so anything executed subsequently will see that value?

  • Urgent - Assign Value To Bounded Variables

    In My Application Module I Create View With Bound Variables in The Where Condition, I Create Manual JSP To List The Data From The View As Reports Done.
    Pls. Tell Me How & Where I Can Assign Value To The Bounded Values At Run Time
    Regards
    ABG

    If your datasource tag introduces a scripteable vairiable named 'ds' you can use a scriptlet as follows:
    <%
    ds.getRowSet().setWhereClauseParam(int index, Object value);
    %>
    the index is the parameter index, the value is the value of tha parameter. Please look at the BC4J runtime Javadoc for more information.

  • Not able to get the value of ODI Variable when i pass thru Option

    Hi,
    I have ODI variable called prev_etl_run_date which will hold the last successful etl run date. I want to use the value of this variable in one of my KM step.
    But i don’t want to use directly in my KM. So I passed the variable name thru KM Option.
    I intend to use the variable’s value in the KM step, as shown below:
    <%=odiRef.getOption("MY_OPTION_1")%>
    Here I am expecting the value of the variable, but here I am only getting the variable name only.
    Is there any substitution method available in ODI KM , please help me to solve this issue.
    Thanks
    nidhi

    ODI options are not intended for run time parameters. They are like design choices or debugging flags or parameters that can be specified in code template. Previous ETL run time stamp is hardly a design choice.
    On the other hand, it is really a bad practice to put a variable inside KM directly. That creates a dependency that you can easily avoid by putting a filter using that variable in the interface.

  • XSL-How to get value of a variable from inside loop-- to the outside loop?

    Pls help
    hi im currently working on this xsl file..
    This works on generating a txt file,my problem right now is
    ' how can i get the value of a variable generated from the inside forloop,
    i have to get the total,sum value of this variables after performing the loop
    ***this is the for loop
    <xsl:for-each select="OutboundPayment">
    <xsl:variable name='id' select='generate-id(OutboundPayment)'/>
    <xsl:sort select="PaymentNumber/CheckNumber" data-type="text" />
    <xsl:variable name='PValue' select='format-number(100*PaymentAmount/Value,"0000000000000")'/>
    <xsl:value-of select='$id'/>
    <xsl:text>D</xsl:text>
    <xsl:value-of select='$DDate'/>
    <xsl:value-of select='$Batch'/>
    <xsl:text>3</xsl:text>
    <xsl:value-of select='format-number(PaymentNumber/PaymentReferenceNumber,"0000000000")'/>
    <xsl:value-of select='format-number(PayeeBankAccount/BankAccountNumber,"0000000000")'/>
    <xsl:value-of select='substring(Payee/Name,1,20)'/>
    <xsl:value-of select='$PValue'/>
    <xsl:variable name='Addend' select='concat($DDate,substring($DAcct,5,5),$Batch)'/>
    <xsl:variable name="LHash">
    <xsl:call-template name="GetHash">
    <xsl:with-param name="A1" select="$PValue" />
    <xsl:with-param name="A2" select="$Addend" />
    </xsl:call-template>
    </xsl:variable>
    <xsl:value-of select="concat('[',$LHash,']')" />
    <!--LHash*i have to get the total amount of this one from the outside loop /---->
    <xsl:call-template name='NewLine'/>
    </xsl:for-each>
    <!--I have to put in here the total value of that LHash/---->
    <!--This is the template on how to get the value of that variable in the inside loop/---->
    <xsl:template name="GetHash">
    <xsl:param name='A1'/>
    <xsl:param name='A2'/>
    <xsl:variable name='TwoSum' select='format-number($A1+$A2,"000000000000000")'/>
    <xsl:variable name='Weight' select='317191314191112'/>
    <xsl:call-template name="WDigit">
    <xsl:with-param name="Cnt" select="15"/>
    <xsl:with-param name="Sum" select="$TwoSum"/>
    <xsl:with-param name="Wgt" select="$Weight"/>
    <xsl:with-param name="Tot" select="0"/>
    </xsl:call-template>
    </xsl:template>
    <xsl:template name='WDigit'>
    <xsl:param name='Cnt'/>
    <xsl:param name='Sum'/>
    <xsl:param name='Wgt'/>
    <xsl:param name='Tot'/>
    <xsl:choose>
    <xsl:when test="$Cnt > 0">
    <xsl:variable name='Multip' select='substring($Wgt,$Cnt,1)'/>
    <xsl:variable name='Factor' select='substring($Sum,$Cnt,1)'/>
    <xsl:variable name='Prduct' select='$Multip$Factor'/>
    <!--xsl:value-of select="concat($Tot,'[',$Cnt,']')"/-->
    <!--xsl:value-of select="concat($Multip,'x',$Factor,'=',$Prduct)"/-->
    <!--xsl:call-template name='NewLine'/-->
    <xsl:call-template name="WDigit">
    <xsl:with-param name="Cnt" select="$Cnt - 1"/>
    <xsl:with-param name="Sum" select="$Sum"/>
    <xsl:with-param name="Wgt" select="$Wgt"/>
    <xsl:with-param name="Tot" select="$Tot+$Prduct"/>
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <xsl:variable name="Rem" select="$Tot mod 11"/>
    <xsl:variable name="Chk" select="11 - $Rem"/>
    <xsl:value-of select="format-number(concat($Tot,$Chk),'00000')"/>
    </xsl:otherwise>
    </xsl:choose>
    <xsl:template name='GetTotal'>
    </xsl:template>
    Thanks in advance for those who are willing to help.
    -Leighya

    It would have helped if you had posted your code as CODE but as it is, I could hardly read it. My guess about what you are asking is, if you want a template to return a value, just write that value to the result stream inside the template.
    If that wasn't what you were asking, then please post your code in a readable format.

  • Dynamically assign value to bind variable in a view object before pageload

    I found that it is extreamely hard to find an example to assign the bind variable in View object at runtime using a data attribute defined in Human task activity. Most of the available samples use a Literal value to do the assignment. In my case, I want to dynamically display the content by assigning the data attribute in Human task to the bind variable in view object before a pageload.
    I do not want to bind the view object to some command component to click a button or link in order to make it work (Unnecessary components in my page).
    The issue is how to access the data attribute in Human task in the java code of client interface in AppModule? or is there a way that I can access the data attribute in Groovy script expression of the bind variable? or if I can access the process data object defined in my BPM process to do the assignment at runtime?
    Really need help on the issue, and I cannot believe that it is so hard to accomplish.
    Thank you very much,

    chk this
    Passing default value to bind variable on page load.
    http://adfcodebits.blogspot.com/2010/03/bit-2-setting-bind-variable-value.html

  • Error in assigning value to local variable

    i am writing a stored procedure in which i have pass parameter if parameter value is zero then i assign a previously declared variable null else that value
    syntax is this
    create or replace
    PROCEDURE usp_Add_Update_Insurance
    p_CityID IN NUMBER DEFAULT NULL
    as
    v_CityID number(10,0);
    begin
    IF p_CityID = 0 THEN
    BEGIN
    v_CityID := NULL;-----giving error in this line
    else
    v_CityID:=p_CityID;
    END;
    END IF;
    end
    begin
    ///some query
    end
    please help someone

    I think there is no added value by putting those Begin/End.
    The simplest solution is just remove them
    Create Or Replace
    Procedure Usp_Add_Update_Insurance (
         P_Cityid In Number Default Null
    ) As
         V_Cityid Number(10,0);
    Begin
         If P_Cityid = 0 Then    
              V_Cityid := Null;
         Else
              V_Cityid:=P_Cityid;
         End If;
         -- do something with V_Cityid    
    End; The only reason for having Begin/End is if you want to catch some exceptions or perform some strange local variable declarations. But it does not seems to be case here.
    MJ

Maybe you are looking for

  • Excel 2004 and saving webpages - help!

    I'm working on a project where we're trying to save a large number of excel sheets as html so we can link them together in various ways. As the only person in the office who can write html, I'm stuck with it. The problem is, using the 'save as webpag

  • Synchronous XI Scenario in Real Time

    Hi, We are having a scenario in which PDA devices would communicate to SAP systems through XI. PDA devicves would send a request and SAP responds back. This is a Synchronous scenario. The interface is designed for operating personnel in warehouse who

  • Keep in a variable the last record on which we were

    Hi, I have a multi records blocks and I want to ask if the user want to save his changes before going on another record. Is it possible in the when-mouse-click to obtain the record on which the user was precedently and verify if it is the same that h

  • Voicemail Alert

    I would like to know if there is a setting I am missing, or even an app that will make the alert sound activate more than once for a voicemail. If I don't happen to hear it the first time, it could be hours before I see I had a missed call & voicemai

  • Help in running bak2db script

    Hi all. My direcotry server went down by itself !; and never seem to start again. I have been trying all means to start it; but no luck. i get the following error log: [07/Oct/2003:04:37:47 +0500] - libdb: /apps/iDS51/slapd-expro100/db/log.0000000007