How use return value of JavaBeanShell ODI prodecure in Interface Mapping

My source data is in Complex FIle and Target data is in Oracle.
I have written ODI procedure using JavaBeanShell technology
The "command on Source" is below (actual implementation is much more complex):
/---------------For Example-----------------------
<@
import java.sql.*;
public class JBTest
     public static String test() throws Exception
          conn=odiRef.getJDBCConnection("SRC");
          Statement stmt=conn.createStatement();
          String result="";
          ResultSet rs=stmt.executeQuery("select SNPSLOADDATE from ROOT_ELEMENT");
          while(rs.next()){
               result = rs.getString(1);
          return result;
@>
Is it possible to use this "result"(return val of function test) in Interface mapping implementation.
If yes how?
Or any way to assign this return value to an ODI variable.

Hi,
I have done using PL/SQL or a simple select from dual statement under oracle tech in function/procedure which can used anywhere.
I tried using return in java bean shell , didn't worked.
Unfortunately there is little / no document about how to use java bean shell in ODI. Alternatively you can try jython.

Similar Messages

  • How to use return value from TestComplete ( using COM) as a variable in the conditional statement (e.g. while loop) in TestStand

    Hi,
    I have setup a COM interface for TestStand(TS) to run certain scripts in TestComplete (TC).  Normally, when TestComplete finishes executing the script, it returns a 0 or 1 to denote pass/fail in the TestStand step (e.g String value test step).  This worked fine.
    However, now I need TestComplete to return a vaule( e.g 32) to TS, and TS need to evalue this value in a while statement. So if TC return value is 32, I'd have some statement in TS ike :                                                                                                 
    While (return value != 30)
    Do something..
    Thanks,
    Solved!
    Go to Solution.

    There are a hundred ways to implement what you are asking.  The hard part is deciding which one would be the best for you.
    What adapter are you using to communicate with TestComplete?  ActiveX?  Is TestComplete running asynchronously (in parallel)?  If so then how is the data getting back to TestStand?
    So here are some options:
    1. You can use the While Step type.  It's in the Flow Control folder in your Step Types pallette.  Look in your examples under UsingFlowControlSteps.seq in the SequenceFlow
    2. You can loop on a step and have the termination for the loop be (return value == 30).  Look in the Step Properties under Looping.  Also in the TestStand help
    3. You could do Post Actions based on a condition and have it jump to another step.  Read about it in the TestStand Reference Manual.
    4. You could use a GoTo step.  I don't really recommend this one.  It makes code hard to maintain.  Also an example in SequenceFlow called gotobeep.seq.
    Hopefully this gets you thinking.  Let me know if you have specific questions about any of these methods.
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • Best way to use return values in a webservices

    Hi all,
    Scenario: We have three web services. What is the best way to do this acitivity or is it possible?
    webservice1
    webservice2
    webservice3
    Call invoke webservice1 & 2 (they need to their work do be done parallely and will return a value eg "string")and call webservices3 with input values as the returned value from webservice 1 & 2.
    Thanks,
    Shashi
    Edited by: Shashi_sr on Sep 17, 2010 1:46 PM

    Hi Shashi,
    The way to achieve your desired functionality is as follows:
    Create a flow activity, and within that flow activity, you will call web services (using an invoke activity) webservice1 and webservice2.
    After the flow activity, you will then use another invoke activity to call the 3rd webservice using the output given by the first 2 webservices.

  • Getting return value of a method in an interface

    Hello! I have a problem. I have an interface called I. One of the declared method in this interface is M. And I have a class called C. Class C declares Interface I. I want to get the return value of the method M. I used invoke method. M.invoke(anInstance, arg[]). You can't take the instance of interfaces or abstract classes. If I use a class instead of instance for anInstance variable, i get "java.lang.IllegalArgumentException: object is not an instance of declaring class" error. If I use an instance, i get "java.lang.IllegalAccessException: Can not call newInstance() on the Class for java.lang.Class" error. This is because of getting an instance of an interface. if you can help me. i will be greatfully happy.

    Thanks for the feedback Tom although you should rethink what you said.
    I did not trash your suggestion, nor did I make any reference to it.
    Perhaps you should read the OP to see where you went wrong.
    OP wants to know return type of Interface's methodNo, the OP wants to obtain the return value.
    AND OP knows that instantiation won't work.He was trying to instantiate an Interface, which is not possible. In order for him invoke a Method he needs a concrete implementation. I was simply pointing out what he needs to do in order to acheive his aim.
    b) there may be no known implementing classes at
    runtimeIf there is no implementing class provided then he will not be able to invoke a method on its instance.
    c) even if there were such a class, instantiating it
    may have unwanted side effects, takes unnecessary
    timeWhy is that a problem? One reason for invoking M is to see what happens.
    the class may have N methods while the interface
    has only one, so you might look for the correct method
    too longIf you bothered to study the code I supplied I obtain a Method from the Interface class so there is no problem in "looking" for a method, besides which there can be exactly 1 method with a given signature in any class so there is no searching involved.
    On a personal note, such negative replies are neither helpful to the OP and can cause a credibility problem caused by being labelled a Troll.

  • How to return Values from Oracle Object Type to Java Class Object

    Hello,
    i have created an Oracle Object Types in the Database. Then i created Java classes with "jpub" of these types. Here is an example of the type.
    CREATE OR REPLACE TYPE person_type AS OBJECT
    ID NUMBER,
    vorname VARCHAR2(30),
    nachname VARCHAR2(30),
    geburtstag DATE,
    CONSTRUCTOR FUNCTION person_type RETURN SELF AS RESULT,
    CONSTRUCTOR FUNCTION person_type(p_id NUMBER) RETURN SELF AS RESULT,
    CONSTRUCTOR FUNCTION person_type(p_vorname VARCHAR2,
    p_nachname VARCHAR2,
    p_geburtstag DATE) RETURN SELF AS RESULT,
    MEMBER FUNCTION object_exists(p_id NUMBER) RETURN BOOLEAN,
    MEMBER PROCEDURE load_object(p_id NUMBER),
    MEMBER PROCEDURE save_object,
    MEMBER PROCEDURE insert_object,
    MEMBER PROCEDURE update_object,
    MEMBER PROCEDURE delete_object
    MEMBER PROCEDURE load_object(p_id NUMBER) IS
    BEGIN
    SELECT p.id, p.vorname, p.nachname, p.geburtstag
    INTO SELF.ID, SELF.vorname, self.nachname, SELF.geburtstag
    FROM person p
    WHERE p.id = p_id;
    END;
    My problem is, that if i use the member function "load_object" from my java app it doesnt return the selected values to the java class and i dont know why. I use the java class like this:
    PersonObjectType p = new PersonObjectType();
    p.load_object(4);
    There is a reocrd in the database with id = 4 and the function will execute successful. But if i try to use "p.getVorname()" i always get "NULL". Can someone tell me how to do that?
    Thanks a lot.
    Edited by: NTbc on 13.07.2010 15:36
    Edited by: NTbc on 13.07.2010 15:36

    CallableStatement =
    "DECLARE
    a person_type;
    BEGIN
    a.load_object(4);
    ? := a;
    END;"
    And register as an out parameter.
    Edited by: michael76 on 14.07.2010 05:01

  • Using return value of a pl/sql function in the "where" coarse in a

    Hi,
    I have a question,
    if I have a pl/sql function that returns a boolean value, how can I use
    it directly in a select statement?
    I can easily do this if the function returns a number value , e.g.
    select * from my_table where my_package.function('abc') = 1;
    But I can't figure out how to do this if the function return a boolean.
    Any idea other than creating another function?
    Please reply to me directly as I'm not in the email list. Thanks.

    BOOLEAN is not a SQL datatype - you can only reference Boolean values in PL/SQL.

  • How to return values from a BSP page to Javascript

    Hi All,
    I want to call a BSP page which reads a single value from a table and returns that value I want the Javascript in the HTML code to get the value from the BSP page.
    Can you kindly let me know how I can return the value from the BSP page to JavaScript.
    Kindly please provide me a simple code of a BSP page and the Javascript
    Thanks
    Karen

    Hi,
    you need 3 elements to make the javascript code read the value in any field in the table: table´s name, line and column. This is how your code could look like:
    script language="javascript>
       var row = 0;
       function display(){
          row = row + 1;
          campo = 'tabla1_' + row + '_4';                 " <-- table, line, column
          valor = document.getElementById(campo).value;
    </script>
    ROW works as a counter. You have in variable valor the value of the field and can do with it what you want, perhaps display it with ALERT. I am reading the values from field 1 to n in column 4 in table TABLA1. Pay attention to the '_' in the concatenation of field´s name. The table in my BSP is very simple:
    <htmlb:tableView id                = "tabla1"
                           table             = "<%= mytable %>"
                           width             = "100%"
                           allRowsEditable   = "X"/>
    and somewhere I must call function display in my javascript code:
    <htmlb:button  id="boton" text="Texto aqui" onClientClick="display()" />
    So, give it a try.

  • Display as text based on pl/sql - how to return value

    Hi,
    I have a item set as "display as text based on pl/sql". How do I get the PL/SQL anonymous block to return the value of the item?
    My function declares and populates a variable called t_output which is the value I want displayed in the item. The PL/SQL I have written is correct as I have tried it in SQLPlus* with DBMS_OUTPUT.PUT_LINE and I get the correct output, but I don't know how to set my item to the value of t_output. I have tried adding ":P73_ITEM := t_output;" into the end of the PL/SQL block.
    Thanks
    Lucy

    Hi Lucy,
    Try this and see.
    make the display as:display as text(saves state)
    source type: sql query
    in source value or expression type
    select func(arguments) from table name;
    Good luck

  • How use "All Values" in the pages of pivot tables

    Hi everyone,
    I’m using Oracle Bi Answers and I have the following problem:
    I’m doing reports based in a datamart with 2 fact table each with about 28 Million records per month and with a medium of 14 dimensions.
    The users want to have the choice to select 5 parameters for example (region, district, type of product, month of analysis, subtype of product) where they can select an individual option as well as select an “all values” option. They want this for all the parameters.
    We are having problems doing this without having the report to timeout.
    Approaches used
    We are trying to do this by using pivot tables and combo boxes in the reports (one for each parameter). The combos are in the pages area.
    We are trying to do a calculated item with Sum(*) to have a “ALL Values” in the combo box but this makes the report extremely slow.
    We also tried to do Sum in the pages section of the pivot table but it only displays the “All pages value” of the first combo box.
    So actually I don’t know what to try. Can you help me with the best way to do this?
    Thanks
    Edited by: user8727081 on Sep 28, 2009 2:45 AM

    Hi,
    I had the same problem, and I solved it using the dashboard prompts.
    But sometimes users are not happy. I explaine why.
    Suppose a dimension Nation:
    Italy, Germany, UK, France, USA
    1) I create a report with sales quantity.
    2) Report has a filter --> "nation" = is prompted
    3) I create a dashboard prompt "Nations" based on dimension Nation with All Values
    4) I publish the report in a dashboard with the dashboard prompt "Nations"
    When user choose the nation from the prompt, all nations are displayed, also if I have NO sales for some of these.
    My goal: only nations with sales must be shown
    Thanks
    Enrico

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

  • Defining return values of the same class in interface implementations

    hello,
    i'm trying to update older code to java 1.5 using generics. i'm new to generics and i have a problem i cannot solve: assuming the interface
    public interface Stake
         public Stake makeACopyAndShift( long delta );
    }and the class
    public class BasicStake
          private final long pos;
          public BasicStake( long pos )
                 this.pos = pos;
          public Stake makeACopyAndShift( long delta )
                  return new BasicStake( pos + delta );
    }... and a container class Trail:
    public class Trail<S> {
           private final List<S> stakes = new ArrayList<S>();
           public Trail() {}
           public void add( S stake ) { stakes.add( stake ); }
           public S get( int index ) { return stakes.get( index ); }
           public void shiftAll( long delta )
                  final List<S> stakesNew = new ArrayList<S>( stakes.size() );
                  S orig, copy;
                  for( int i = 0; i < stakes.size(); i++ ) {
                          orig = stakes.get( i );
                          copy = (S) orig.makeCopyAndShift( delta );
                          stakesNew.add( copy );
                  stakes.clear();
                  stakes.addAll( stakesNew );
    so that i could do:
    Trail<BasicStake> t = new Trail<BasicStake>();etc.
    how do i manage to get rid of the warning
    "Type safety: The cast from Stake to S is actually checking against the erased type Stake"
    with casting to (S) in the for-loop in the shiftAll function? Obviously the problem is that in interface Stake the return type of makeCopyAndShift should not be Stake but "<SameClassAsMe>", so that in BasicStake the method would be
    public BasicStake makeCopyAndShift( long delta ) { ... }. how do i accomplish that?
    thanks a lot!
    ciao, -sciss-

    This seems to work just fine for me:
    public class Foo {
        public static void main(String[] args) {
            Trail<Stake> trail = new Trail<Stake>();
            trail.add(new BasicStake(1L));
            trail.add(new AnotherStake(1L));
            trail.shiftAll(10L);
    interface Stake {
         public Stake makeACopyAndShift(long delta);
    class BasicStake implements Stake {
        private final long pos;
        public BasicStake(long pos) {
            this.pos = pos;
        public Stake makeACopyAndShift(long delta) {
            return new BasicStake(pos+delta);
    class AnotherStake implements Stake {
        private final long pos;
        public AnotherStake(long pos) {
            this.pos = pos;
        public Stake makeACopyAndShift(long delta) {
            return new AnotherStake(pos*delta);
    class Trail<S extends Stake> {
        private final List<Stake> stakes;
        public Trail() { stakes = new ArrayList<Stake>(); }
        public void add(S stake) { stakes.add(stake); }
        public Stake get(int index) { return stakes.get(index); }
        public void shiftAll(long delta) {
            final List<Stake> stakesNew = new ArrayList<Stake>(stakes.size());
            for(int i = 0; i < stakes.size(); i++ ) {
                Stake orig = stakes.get(i);
                Stake copy = orig.makeACopyAndShift(delta);
                stakesNew.add(copy);
            stakes.clear();
            stakes.addAll(stakesNew);
    }

  • How comples return types and parameters are mapped

    Hi all!
    I want to know how complex return types and parameters in a java interface gets mapped to wsdl? for example how would the wsdl for the following interface shall look like:
    interface ComplexReturns{
       java.util.Date getLuckyDate(java.util.Date DoB);
       myPack.MyClass getMyClass();
    }

    Hi,
    - In your application module, make a public method that returns an arry, for example an arry of strings[]
        public String[] returnTwoVals(){
            String[] returnvals = {"1","2"};
            return returnvals;
        }- expose this method in the application module
    - in the user interface drag/drop the returnTwoVals method on a page and choose to create a button.
    - double click the button to generate the binding code
        public String commandButton_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding =
                bindings.getOperationBinding("returnTwoVals");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
        }- you can access the values in the arry by adding this code after the Object result =...
       String[] vals = (String[])result;
       System.out.println(vals[0] + " - " + vals[1]);

  • Exporting and returning value question

    What is different between exporting and returning value in method of a class. if created an object inside the method and exporting it, it means I have a reference to that object inside program. If I use returning value, it means I have a copy of object created inside the method, but the object inside method is destroyed after it ends. Do I understand correctly? if so what do u prefer exporting or returning value? thanks!

    Hello Anthony
    The major difference is that you can have multiple EXPORTING parameters yet only a single RETURNING parameter. In addition, if you have a RETURNING parameter you cannot have EXPORTING parameters simultaneously.
    Defining methods with a single RETURNING parameter is more Java-like than having multiple EXPORTING parameters.
    Whenever possible and sensible I prefer RETURNING parameters over EXPORTING parameters because they allow to use the function method call, e.g.:
    go_msglist = cf_reca_messagelist_create( ).
    Regards
      Uwe

  • How to clear value set values from node info

    Hi,
    I have set some values on value set to display on a dropdown in my view.  using following method.
      l_node_info->set_attribute_value_set(  name      = 'XYZ'  value_set = l_value_set ).
    Now i need to clear node info value set. Otherwise particular attribute which i used for dropdown is always showing values added .
    Please suggest how to clear value set.
    Thanks,
    Venkat.

    Hi,
    Interface IF_WD_CONTEXT_NODE_INFO is for metadata of a node. It has nothing to do with the values in dropdown list.
    In order to manipulate the values in the dropdown of an attributes, you can use the IF_WD_CONTEXT_NODE.
    As you are saying its a dropdown, what I can suggest is to write supply function for the node.
    And then get the index (V_INDEX) of the value you wanted to see in the dropdown list, and then use the following code in the method WDDOINIT
    LO_NODE->SET_LEAD_SELECTION_INDEX( INDEX = V_TABIX ).

  • Getters Methods - Exporting vs Returning value()

    Hi OO Gurus,
    i'm doing a test oo report. On its first version, i declared all data objects in the public section of all classes. Now, i moved all data objects to the private sections for encapsulation purposes. Therefore, i have to implement get methods for everything declared (including tables and references) in the report. My question is:
    What is the best option to create get methods: Create simple methods using the "Exporting" keyword or create functional methods using "Returning value" keywords?
    If i use 'exporting', i'm just able to call the method using 'call method' keywords. However formal parameter may not be fully specified (i can export tables in such method)
    If i use 'returning value', i have a functional method but its parameters must be fully specified.
    What's is the best option in your opinion?
    Thanks!

    In my opinion functional method is better choice, for the following reasons:
    - can be used inline (i.e. as an operand of IF...ENDIF block)
    - you don't have to worry about initializing returning parameters, this is done in each method call. For exporting parameter you have to be very carefull, as they might be already passed to the method with some data in them. Althought it not recommended, it is doable, so before you call such method you have to pay atention to that.
    If i use 'exporting', i'm just able to call the method using 'call method' keywords.
    This is untrue. You can call it like
    ref->method( exporting ....
                          changing .... ).
    So the same way as you would call functional method, but you MUST determine whether is exporting/changing/imporitng parameter unless there are only importing parameters. In this case you can even skip the input/output signature.
    If i use 'returning value', i have a functional method but its parameters must be fully specified.
    Not sure now, but I think you could pass reference to data object (type ref to DATA) and deference it outside the method typing it respectively. I cannot however confirm this right now (no access to system) so here I may mistake. Try it out though.
    Regards
    Marcin

Maybe you are looking for

  • "Manual Planning in SAP Retail w/o MAP

    Hi Can we create "Planning Scenario in SAP Retail w/o MAP " ? Can we do manual plannings in SAP Retail w/o BI , MAP? if so whats the limitation? Which are possible  for the following scenrios in SAP Retail w/o MAP /BI 1. Planning Scenario ( Budget Pl

  • Agent Assignment error in PR Release strategy WS00000038

    Hi I am facing issue in PR Release strategy as specified below. First i copied the Standard workflow and assigned the role 000000148. But i could not able to send it to SAP Inbox. And also applied the code to assign users in the exit FUNCTION EXIT_SA

  • How to create a cluster with a User control (.ctl) programatically using VI scripting?

    Solved! Go to Solution.

  • Little Problem With Zen Mi

    Just after I finish ripping a cd onto my Z.M., I check to see if the songs I uploaded r actually there, and the "back" button doesnt work very well. All the other buttons work fine but that is just a bit harder to press. after a bit it gets better an

  • N73 - SMS Editor Bug

    Hi! I have a N73 ME with Firmware Version 3.0638.0.0.30 (It looks like Nokia wont ever release a newer Firmware for my Product Code 0544952). When i write a SMS and press 3x "0" to get an line break the phone brings me right back to the standby scree