Call a function, which name is in an Array of Strings...

hey all
i have a simple Temp class (made to check things) in a file called Temp.java with the following definition :
public class Temp {
     int data1;
     int data2;
     public Temp (){
          data1=0;
          data2=0;
     (here i have get and set functions for both data1 and data 2, and i have the two following functions)
     public void printAdd(){
          System.out.println("Result : "+(data1+data2));
     public void printSubtract(){
          System.out.println("Result : "+(data1-data2));
}i have another class called Server who has the following simple code :
public class Server {
      public static void main( String args[] )
           String[] table={"printAdd","printSubtract"};
           Temp game=new Temp();
           game.setdata1(8);
           game.setdata2(4);
          //the following two calls work perfectly
           game.printAdd();
           game.printSubtract();
               System.out.println(table[0]);
//but the following does not...
           game.(table[0]);
}as probably you have understood i am trying to call a function to the object game which name is in the String table... how can i actually made a call game.(THE_VALUE_OF_STRING_IN_AN_ARRAY) ...?

i want to call the function printAdd() to the game object..
but i want the program to find out the name of the function to call.. i want to execute the function whose name is at the array in position 0 -> table[0]
so i want the program to resolve the table[0] to printAdd and the use it and call it on object game...

Similar Messages

  • How to call a function, which name is stored in table?

    Dear members,
    I have a function with return number, and store its name in a table.
    now I want to select this function name from table and run it and return the value to a variable in my form.
    here is my code in when-button-pressed trigger.
    DECLARE
         v_value number;
         V_FUNC VARCHAR2(100);
         V_PARAM VARCHAR2(100);
    begin
         select FUNCTION_NAME, PARAM
         INTO V_FUNC, V_PARAM
         from function_table
         where id =1;
         message('V_FUNC='||V_FUNC); pause;
         v_value := v_func||';'; --run_tb_function;
         :text01 := v_value;
    end;this code gives the following error:
    ora-06502
    regards:
    Edited by: user2040934 on Feb 2, 2013 9:47 AM

    Below is the modified code:
    DECLARE
         v_value number;
         V_FUNC VARCHAR2(100);
         V_PARAM VARCHAR2(100);
    v_cmd varchar2(1000);
    begin
         select FUNCTION_NAME, PARAM
         INTO V_FUNC, V_PARAM
         from function_table
         where id =1;
    -- create a valuetable with one column vval varchar2 type
         v_cmd := 'declare val varchar2(100); Begin val := '||v_func||'; delete from valuetable; insert into valuetable(vval) values (v); commit; end;';
    forms_ddl(v_cmd);
    begin
    select vval into :text01 from valuetable where rownum = 1;
    exception
    when no_data_found then
    -- do your action....
    null;
    end;
    end;
    Edited by: user5213229 on Feb 2, 2013 4:33 PM

  • How to call a function which has a cursor

    hey folks I have a function which has a cursor,,like this
    CREATE OR REPLACE FUNCTION EMPCU RETURN VARCHAR
    AS
    CURSOR EMPC IS
    SELECT LNAME,SALARY,SSN
    FROM EMPLOYEE
    WHERE DNO IN(4,5);
    EMPV EMPC%ROWTYPE;
    BEGIN
    OPEN EMPC;
    LOOP
    FETCH EMPC INTO EMPV;
    EXIT WHEN EMPC%NOTFOUND;
    /*DBMS_OUTPUT.PUT_LINE(EMPV.LNAME||' '||EMPV.SALARY||' '||EMPV.SSN);*/
    RETURN EMPV. LNAME ||' '|| EMPV.SALARY||' '||EMPV.SSN;
    END LOOP;
    CLOSE EMPC;
    END EMPCU;
    Above function created successfully. I called above function like this
    DECLARE
    ENAMESAL VARCHAR2(70);
    BEGIN
    ENAMESAL:=EMPCU();
    DBMS_OUTPUT.PUT_LINE(ENAMESAL);
    END;
    Function is called and function is returning only one row instead of 7 rows. Actually cursor is supposed to return 7 rows but it is returning only one row. Is there any snytax to call a function which has a cursor. So experts please tell me where I have to make changes. I would be very thankful to you

    Well, you've told the function to RETURN within the loop, so after the first record in the loop, the function returns as you've instructed it.
    You would need to change your function to accept a specific input from the EMP table and then do a look up for that specific record and return the values you wanted, and wrap the function call in a loop in your anonymous block.
    Or you could just have the anonymous block like this....
    BEGIN
       FOR X IN
          SELECT EMPV. LNAME ||' '|| EMPV.SALARY||' '||EMPV.SSN AS Line_Data
          FROM EMPLOYEE
          WHERE DNO IN(4,5)
       LOOP 
          DBMS_OUTPUT.PUT_LINE(x.Line_Data);
       END LOOP;     
    END;
    /

  • How to call oracle Function which has If else condition in Data Template

    Hi,
    currently I am working on creating Data Template which uses a Oracle Function which I need to make use in my data template. But I have some confusions on using the same. Could anybody please help me in this regard.
    I have a function like this,
    function invoice_query (p_facility_id facility.facility_id%TYPE,
    p_wave_nbr pick_directive.wave_nbr%TYPE,
    p_container_id unit_pick_group_detail.container_id%TYPE,
    p_distro_nbr unit_pick_group_detail.distro_nbr%TYPE) return invoice_refcur IS
    refcur invoice_refcur;
    begin
    IF p_wave_nbr IS NOT NULL THEN
    OPEN refcur FOR SELECT t1.distro_nbr,
    t1.cust_order_nbr,
    t1.pick_not_before_date,
    SYSDATE,
    t1.ship_address_description,
    t1.ship_address1,
    t1.ship_address2,
    t1.ship_address3,
    t1.ship_address4,
    t1.ship_address5,
    t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip,
    t1.ship_country_code,
    t1.bill_address_description,
    t1.bill_address1,
    t1.bill_address2,
    t1.bill_address3,
    t1.bill_address4,
    t1.bill_address5,
    t1.bill_city || ', ' || t1.bill_state || ' ' || t1.bill_zip,
    t1.bill_country_code,
    min(t2.pick_order),
    NULL,
    t2.wave_nbr
    FROM stock_order t1,
    pick_directive t2,
    unit_pick_group_detail t3
    WHERE t1.facility_id = t2.facility_id
    AND t1.facility_id = t3.facility_id
    AND t2.facility_id = t3.facility_id
    AND t1.distro_nbr = t2.distro_nbr
    AND t1.distro_nbr = t3.distro_nbr
    AND t2.distro_nbr = t3.distro_nbr
    AND t1.facility_id = p_facility_id
    AND t2.wave_nbr = p_wave_nbr
    AND g_scp(p_facility_id, 'interface_tcp_flag') = 'N'
    AND t2.pick_type = 'U'
    AND t3.group_id in (SELECT t4.group_id
    FROM unit_pick_group t4
    WHERE t4.facility_id = p_facility_id
    AND t4.wave_nbr = p_wave_nbr)
    GROUP BY t1.distro_nbr,
    t1.cust_order_nbr,
    t1.pick_not_before_date,
    t1.ship_address_description,
    t1.ship_address1,
    t1.ship_address2,
    t1.ship_address3,
    t1.ship_address4,
    t1.ship_address5,
    t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip,
    t1.ship_country_code,
    t1.bill_address_description,
    t1.bill_address1,
    t1.bill_address2,
    t1.bill_address3,
    t1.bill_address4,
    t1.bill_address5,
    t1.bill_city || ', ' || t1.bill_state || ' ' || t1.bill_zip,
    t1.bill_country_code,
    t2.wave_nbr
    ORDER BY MIN(t3.group_id), MAX(t3.slot);
    elsif p_container_id is not null then
    OPEN refcur FOR SELECT distinct t1.distro_nbr,
    t1.cust_order_nbr,
    t1.pick_not_before_date,
    SYSDATE,
    t1.ship_address_description,
    t1.ship_address1,
    t1.ship_address2,
    t1.ship_address3,
    t1.ship_address4,
    t1.ship_address5,
    t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip,
    t1.ship_country_code,
    t1.bill_address_description,
    t1.bill_address1,
    t1.bill_address2,
    t1.bill_address3,
    t1.bill_address4,
    t1.bill_address5,
    t1.bill_city || ', ' || t1.bill_state || ' ' || t1.bill_zip,
    t1.bill_country_code,
    NULL,
    t2.dest_id,
    null
    FROM stock_order t1,
    unit_pick_group_detail t2
    WHERE t1.facility_id = t2.facility_id
    and t1.distro_nbr = t2.distro_nbr
    and t1.facility_id = p_facility_id
    AND g_scp(p_facility_id, 'interface_tcp_flag') = 'N'
    AND t2.container_id = p_container_id;
    else
    open refcur for SELECT distinct t1.distro_nbr,
    t1.cust_order_nbr,
    t1.pick_not_before_date,
    SYSDATE,
    t1.ship_address_description,
    t1.ship_address1,
    t1.ship_address2,
    t1.ship_address3,
    t1.ship_address4,
    t1.ship_address5,
    t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip,
    t1.ship_country_code,
    t1.bill_address_description,
    t1.bill_address1,
    t1.bill_address2,
    t1.bill_address3,
    t1.bill_address4,
    t1.bill_address5,
    t1.bill_city || ', ' || t1.bill_state || ' ' || t1.bill_zip,
    t1.bill_country_code,
    NULL,
    NULL,
    t3.wave_nbr
    FROM stock_order t1,
    unit_pick_group_detail t2,
    unit_pick_group t3
    WHERE t1.facility_id = t2.facility_id
    and t2.facility_id = t3.facility_id
    and t1.distro_nbr = t2.distro_nbr
    and t2.group_id = t3.group_id
    and t1.facility_id = p_facility_id
    AND g_scp(p_facility_id, 'interface_tcp_flag') = 'N'
    AND t2.distro_nbr = p_distro_nbr;
    END IF;
    return refcur;
    end;
    I have created data template like following,
    <sqlStatement name="Q_INVOICE">
                   <![CDATA[
              SELECT Pack_Slip_R.invoice_query(:P_FACILITY_ID,:P_WAVE_NBR,:P_CONTAINER_ID,:P_DISTRO_NBR) from dual
                                                     ]]>
    </sqlStatement>
    But how does I create a element for the "t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip" column in the oracle function. I normally create an element like following,
    <group name="G_INVOICE" source="Q_INVOICE">
                   <element name="CUST_ORDER_NBR" value="cust_order_nbr"/>
                   <element name=":dest_id" value="dest_id"/>
    </Group>
    But how do i create element if a column name is kind of dynamic. Please help. I cannot Rename/change the Column in SQL Query. Please let me know If I could handle this whole logic in BI Publsiher.
    Regards,
    Ashoka BL

    try useing alias
    t1.ship_city || ', ' || t1.ship_state || ' ' || t1.ship_zip as <COLUMN_ALIAS>

  • Error 1097 after calling dll function which allocates memory inside

    Hello!
    When a call one my functions in my dll from LabView, i get an error 1097. My function takes a few arguments and then allocates some memory for measurement.
    It's not returning any pointers to that memory area, it is just allocates that memory for itself. I don't know what could be the problem, probably i am missing something.
    Could you help please?
    Best regards,
    Tamas
    Solved!
    Go to Solution.

    Are you sure that the allocate function is the problem?
    Error 1097 simply means something inside the external code wrote into memory locations that it was not meant to write. That is usually because of output buffer parameters that are not allocated (large enough) in LabVIEW when passed to the external code fucntion, so the function assuming it received a buffer of a certain size happily writes into that buffer but overwriting other information it should not have.
    But that is by far not the only possibility to cause this error. A simple bug in the external code can cause the same problem when a pointer goes astray or such. The fact that you used that library elsewhere already without seeing any problem is unfortunately no guarantee that the function is not buggy. The LabVIEW exeception handling around the Call Library Node has gotten rather picky and can detect violations that do not have to cause visible problems at all. But the violations it detects are real violations so just silencing them is not a good idea, as they could cause all kinds of problems including overwriting vital data structures in your program that either cause a crash later on or simply wrong results in other parts of your program. Especially the last one is a total bummer to debug.
    Without seeing much more of your code it is basically impossible to point out where the problem could lie. The particular Allocate function doesn't look like there is much that could be done wrong, but I would assume that you call several other functions too somewhere, which could cause the problem. If you can absolutely positively say that you never ever call any library function with a to short (or unallocated) buffer parameter, then you will have to take it up with the manufacturer of your lib, as it would seem very likely that there is some problem in there.
    Also you pass a handle to the library function but your Allocate function does not have this as a parameter! Where does this handle come from? Are you sure you have allocated and prepared it properly before calling this function? A handle is quite often a pointer, although usually a so called opaque pointer meaning the user of the library does not and should not know anything about the structure this pointer points to. It is only known internal to the library.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Error while calling the function which returns SQL Query!!!

    Hi,
    I have a Function which returns SQL query. I am calling this function in my APEX report region source.
    The query is dynamic SQL and its size varies based on the dynamic "where clause" condition.
    But I am not able to execute this function.It gives me the following error in APEX region source.
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Even in SQL* Plus or SQL developer also same error .
    The length of my query is more than 4000. I tried changing the variable size which holds my query in the function.
    Earlier it was
    l_query varchar2(4000)
    Now I changed to
    l_query varchar2(32767).
    Still it is throwing the same error.
    Can anybody help me to resolve this.???
    Thanks
    Alaka

    Hi Varad,
    I am already using 32k of varchar2. Then also it is not working.
    It is giving the same error. I think there is something to do with buffer size.
    My query size is not more than 4200. Even if i give 32k of varchar2 also buffer is able to hold only 3997 size of the query only.
    Error is
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Tried CLOB also. It is not working.
    Any other solution for this.
    Thanks
    Alaka

  • Calling a function which has a CLOB parameter via an anonymous block.

    OK,
    we are moving a lot of exports currently done by Crystal to just be done by stored procs.
    So we have a load of existing, some extremely length SQL statements used for these exports.
    IN the exports, we have meaningful column headings, so we have a 'lookup' file where all the column names are listed with the desired column name text listed against it.
    So - to make our lives easier(i thought) , I have written a Oracle function to extract al;l of the column names as a list (see below).
    It works fine except for when I am trying to pass in a SQL treatment that is longer than 4000 character.
    What I want to be able to do is simply have an anonymous block that callls my function, I will be running this via SQL explorer.
    Something like......
    DECLARE
    theSQL CLOB;
    BEGFIN
    theSQL := 'SELECT * FROM ORDERS WHERE 1=0';
    SELECT GET_COLUNS_AS_LIST( theSQL, 0 ) FROM DUAL;
    END;
    However, when I run this I get the error................
    PLS-00428: an INTO clause is expected in this SELECT statement
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    If I hard code the SQL like this, SELECT GET_COLUNS_AS_LIST( 'SELECT * FROM ORDERS WHERE 1=0', 0 ) FROM DUAL; all is well.
    Also, I am going to need to be able to pass in SQL ststement longer that 4000 characters as weel so please bear that in mind.
    I am not an Oracle guy, so I guess I am missing something fundamental - Please enlighten me with regards to this.
    Any help extremely appreciated.
    CREATE OR REPLACE FUNCTION GET_COLUNS_AS_LIST( P_SQL IN VARCHAR2, Add_Equals_Sign Number := 0)
    RETURN CLOB
    IS
    fResult VARCHAR2(32000);
    HNDL NUMBER;
    d NUMBER;
    colCount INTEGER;
    i INTEGER;
    rec_tab DBMS_SQL.DESC_TAB;
    cCRLF VARCHAR(2) := CHR(13) || CHR(10);
    LONG_SQL dbms_sql.varchar2s;
    n INTEGER;
    l INTEGER;
    u INTEGER;
    StartPos INTEGER;
    BEGIN
    --INITIIALISE RESULT
    fResult := '';
    HNDL := DBMS_SQL.OPEN_CURSOR;
    l := Length( P_SQL );
    u := ( l / 1000 ) + 1;
    FOR n IN 1..u
    LOOP
    StartPos := ( n - 1 ) + 1;
    LONG_SQL( n ) := SubStr( P_SQL, StartPos, 1000 );
    END LOOP;
    if HNDL <> 0 THEN
    DBMS_SQL.PARSE ( c => HNDL,
    statement => LONG_SQL,
    lb => 1,
    ub => u,
    lfflg => false,
    language_flag => DBMS_SQL.NATIVE );
    --DBMS_SQL.PARSE( HNDL, P_SQL, DBMS_SQL.NATIVE);
    d := DBMS_SQL.EXECUTE( HNDL );
    DBMS_SQL.DESCRIBE_COLUMNS( HNDL, colCount, rec_tab);
    FOR i in 1..colCount
    LOOP
    IF Add_Equals_Sign > 0 AND i > 1 THEN
    fResult := ltrim( fResult || '=' || cCRLF || UPPER( rec_tab( i ).col_name ), cCRLF );
    ELSE
    fResult := ltrim( fResult || cCRLF || UPPER( rec_tab( i ).col_name ), cCRLF );
    END IF;
    END LOOP;
    IF Add_Equals_Sign > 0 THEN
    fResult := fResult ||'=';
    END IF;
    ELSE
    fResult := '!!COULD NOT OPEN CURSOR!!';
    fResult := P_SQL;
    END IF;
    RETURN fResult;
    --Tidy Up 
    DBMS_SQL.CLOSE_CURSOR(HNDL);
    Return 'EGG';
    END;
    --EXAMPLE USAGE
    --Select GET_COLUNS_AS_LIST
    --Select * from SALES_TYPE
    --', 1) FROM DUAL;

    So I have ended up with this.
    When I next get some time, I'd like to be able to strip out the table and simply output the results to an SQL Developer script window without having to go through the table.
    Now this works - but if you see that I am doing something wrong - please point it out.
    Many thanks,
    Ant
    CREATE OR REPLACE FUNCTION GET_COLUNS_AS_LIST( P_SQL IN CLOB, Add_Equals_Sign Number := 0)
    RETURN VARCHAR2
    IS
    fResult VARCHAR2(32000);
    HNDL NUMBER;
    d NUMBER;
    colCount INTEGER;
    i INTEGER;
    ChunkSize INTEGER;
    rec_tab DBMS_SQL.DESC_TAB;
    cCRLF VARCHAR(2) := CHR(13) || CHR(10);
    LONG_SQL dbms_sql.varchar2s;
    n INTEGER;
    l INTEGER;
    u INTEGER;
    StartPos INTEGER;
    BEGIN
    --INITIIALISE RESULT
    HNDL := 0;
    ChunkSize := 4;
    fResult := '';
    --fResult := fResult|| 'A'; 
    HNDL := DBMS_SQL.OPEN_CURSOR;
    --l := Length( P_SQL );
    l := dbms_lob.getLength( P_SQL );
    --l := 50;
    u := Round( l / ChunkSize ) + 1;
    --fResult := fResult|| 'B';   
    FOR n IN 1..u
    LOOP
    StartPos := ( ( n - 1 ) * ChunkSize ) + 1;
    IF StartPos = 0 THEN
    StartPos := 1;
    END IF;
    --LONG_SQL( n ) := SubStr( P_SQL, StartPos, ChunkSize );
    LONG_SQL( n ) := DBMS_LOB.SUBSTR( P_SQL, ChunkSize, StartPos );
    END LOOP;
    --fResult := fResult|| 'C';  
    if HNDL <> 0 THEN
    DBMS_SQL.PARSE ( c => HNDL,
    statement => LONG_SQL,
    lb => 1,
    ub => u,
    lfflg => false,
    language_flag => DBMS_SQL.NATIVE );
    --DBMS_SQL.PARSE( HNDL, P_SQL, DBMS_SQL.NATIVE);
    d := DBMS_SQL.EXECUTE( HNDL );
    DBMS_SQL.DESCRIBE_COLUMNS( HNDL, colCount, rec_tab);
    --fResult := fResult|| 'D';  
    FOR i in 1..colCount
    LOOP
    IF Add_Equals_Sign > 0 AND i > 1 THEN
    fResult := ltrim( fResult || '=' || cCRLF || UPPER( rec_tab( i ).col_name ), cCRLF );
    ELSE
    fResult := ltrim( fResult || cCRLF || UPPER( rec_tab( i ).col_name ), cCRLF );
    END IF;
    END LOOP;
    IF Add_Equals_Sign > 0 THEN
    fResult := fResult ||'=';
    END IF;
    ELSE
    fResult := '!!COULD NOT OPEN CURSOR!!';
    END IF;
    RETURN fResult;
    --Tidy Up 
    IF HNDL <> 0 THEN
    DBMS_SQL.CLOSE_CURSOR(HNDL);
    END IF;
    END;
    -- !!!!HOW TO USE THIS FUNCTION!!!!
    BEGIN
    EXECUTE IMMEDIATE ('DROP TABLE RPT_COLNAME_LOOKUPS;');
    COMMIT;
    EXECUTE IMMEDIATE ('CREATE TABLE RPT_COLNAME_LOOKUPS( COLUMN_NAME CLOB );');
    COMMIT;
    EXCEPTION WHEN OTHERS THEN NULL;
    END;
    DECLARE
    theSQL Clob;
    myresult CLOB;
    BEGIN
    --CLEAR OUT PREVIOUS RWS
    DELETE FROM RPT_COLNAME_LOOKUPS; COMMIT;
    --ASSIGN THE SQL TO RUN IT FOR 
    theSQL := '
    SELECT
    EVENT.EVENT_ID AS COCK_SUCKER,
    EVENT.EVENT_CODE, BLAH, BLAH, VERY LONG SQL STATEMENT';
    --CALL THE FUNCTION PASSING IN THE SQL AND IF I WANT THE = OR NOT
    SELECT GET_COLUNS_AS_LIST( theSQL, 1 ) INTO myresult FROM DUAL;
    --INSERT THE RESULTS INTO A TABLE SO WE CAN GRAB THEM
    INSERT INTO RPT_COLNAME_LOOKUPS SELECT myresult FROM DUAL;
    COMMIT;
    END;
    --THEN LOOK AT THE COLUMNS NAMES IN THIS TABLE
    --SELECT * FROM RPT_COLNAME_LOOKUPS;
    --#############################################################################

  • How can i call a function whose name will be  known only at run time

    how can i make a call to a function whose name will be known only at run time

    Instead, have a function - we should say method -
    with a known name, taking a string as argument.Or, specified classes with known names and a no-arg
    c'tor that implement a mutual interface, so you can
    grab an instance using forName/newInstance, cast the
    reference and invoke the interface's doMagic() method.@OP: Best you describe your actual problem, then we could help you with a better solution maybe.
    -Puce

  • Call a function whose name will not be known before run time

    how can i make a call to a function whose name will not be known to me before run time.

    how can i make a call to a function whose name will
    not be known to me before run time.That smells like a design-flaw! Care to explain what it is you're trying to do exactly? Perhaps I, or someone else, can suggest another (maybe even better/easier) approach.

  • Allocate memory and call dll function which writes to the pointer

    Hi!
    I have a DLL wich has a function like the following example, wich i need to call from labview. In C I need to allocate some memory for the data and of course the struct. I add the pointer and the lengh of the data to the stuct and call the function with the struct. The function itself inserts some values to the stuct and to allocated memory. Has someone a working solution how this can be done with Labview?
    typedef struct Thestruct
     UINT16 val1;
     UINT8 val2;
     UINT8 val3;
     UINT16 dataLength;
     UINT8 *data;
    } T_Thestruct;
    MY_API Status MY_API_CALL udaReceive(Handle handle, T_Thestruct *args);
    I tried in labview (see picture), but I only got values inside the struct as well as the error 1097, the reserved memory inclues the same values as before.
    Solved!
    Go to Solution.
    Attachments:
    CallDll.PNG ‏21 KB

    Tobias_BSH wrote:
    OK, I found the soluton to my own Problem. The alignment on the struct must be corrected in Labview. There must be a 2Bytes dummy value between dataLength and the pointer.
    And please not that your solution only works in LabVIEW 32 bit. In LabVIEW 64 Bit your DLL has to be 64 bit compiled as well in order to be loadable and the pointer then is a 64 bit integer and is usually aligned to 64 bit addresses too. In this particular case since the pointer is already aligned to a multiple of 64 bit (when the additional 2 alignment bytes are added) you won't have to modify the alignment for the 64 bit case, but you have to define a different cluster with the 64 bit integer for the pointer anyhow.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • (How) Can a SP call the Function which has BULK COLLECT return?

    I have a function using BULL COLLECT to put (XML data) many line into a table type record. (I had this as a function because it's gong to call many times).
    From one SP program, I will need to call it to get converted XML data info, how should i call it? If it's single line return, I could use
    my_result := get_tbl_xml(p_xml);
    but when it's table type, even I defined it, it still get error. Here is the program:
    Declare (at package spec)
    TYPE OrderDtl_Tab IS TABLE OF xxx%ROWTYPE INDEX BY BINARY_INTEGER;
    in_OrderDtlTab OrderDtl_Tab;
    FUNCTION get_tbl_xml (p_xml IN CLOB ) RETURN OrderDtl_Tab IS
    BEGIN
    SELECT extractvalue(VALUE(x), '/xxxx/xxxx') AS xxxx BULK COLLECT
    INTO in_OrderDtlTab
    FROM TABLE(xmlsequence(extract(xmltype(p_xml), '/Order/Lines/*'))) x;
    RETURN in_OrderDtlTab;
    END;
    PROCEDURE SAVE_A (p_xml IN CLOB )
    BEGIN
    --- how to call get_tbl_xml to get result, so I will be able to insert into DB table
    in_OrderDtlTab := get_tbl_xml(p_xml);
    END;
    --------------------------------------------------------------------------------------------------------------------

    May be this is better
    FUNCTION get_tbl_xml (p_xml IN CLOB ) RETURN OrderDtl_Tab IS
    BEGIN
    SELECT extractvalue(VALUE(x), '/xxxx/xxxx') AS xxxx BULK COLLECT
    INTO in_OrderDtlTab
    FROM TABLE(xmlsequence(extract(xmltype(p_xml), '/Order/Lines/*'))) x;
    RETURN in_OrderDtlTab;
    END;
    PROCEDURE SAVE_A (p_xml IN CLOB )
    yourrow your_table%rowtype;
    BEGIN
    --- how to call get_tbl_xml to get result, so I will be able to insert into DB table
    in_OrderDtlTab := get_tbl_xml(p_xml);
    FORALL myrowtype
    IN in_OrderDtlTab .FIRST .. in_OrderDtlTab .LAST
    INSERT INTO Your_table
    VALUES in_OrderDtlTab(yourrow);
    END;
    END;

  • How to call Java function which returns byteArray

    context I have a class say
    public class ByteArray{
      public byte[] getByteArray(String str){
           return str.getBytes();
    }Consider i have object of ByteArray (some how) in native C code. I want to call getByteArray("Test") and obtain a byteArray. what is the C JNI function can i use?

    hy
    CREATE OR REPLACE FUNCTION GET_SAL1(NN in NUMBER)
    RETURN BOOLEAN
    IS
    BEGIN
    INSERT INTO STD(ENO) VALUES(NN);
    RETURN TRUE;
    EXCEPTION
    WHEN OTHERS THEN
    RETURN false;
    END;
    you can call :
    if GET_SAL1(NN) then
    else
    error
    end if;
    I hope i understand
    Regards

  • Call a function which is created in differnet layers

    I create function A() in a keyframe in Layer A;
    I would like to execute it in other keyframes in Layer B
    Seems I cannot make it work.
    Anyone can help?
    Thanks
    Daniel

    Have a separate script layer, with no keyframes. Then any
    function defined
    prior to the frame you're at will be available. Typically,
    just use frame 1
    for all your script and it'll be available anywhere.
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • How to return array of unsigned integer pointer from call library function node & store the data in array in labview

    I want to return array of unsigned integer from call library node.
    If anybody knows please help me
    Thanks & Regards,
    Harish. G.

    Did you take a look at the example that ships with LabVIEW that shows how to do all sorts of data passing to DLLs. I believe your situation is one of the examples listed. You can find the example VI in the "<LabVIEW install directory>\examples\dll\data passing" directory.

  • Call core function/constructor by its String name

    Hi,
    I worked out a way to call a function whose name is in a String variable. That is:
    function myFunction()
         trace("Hello!");
    var callFunction:String = "myFunction";
    this[callFunction]();     // "Hello!"
    However, this does not work with "core" fnctions and constructors, for example new constructor.
    So is it possible to, for example, create a variable of a type given in another String variable?
    I mean sth like the following:
    var varType:String = "Array";
    var arrayVar:* = this["new " + varType]();     // being equal to calling new Array();
    Thank you in advance for any help

    Something like this:
    var clazz:Class = flash.utils.getDefinitionByName("Array") as Class;
    var myArr:* = new clazz();
    myArr.push("hello world","I'm an array");
    trace(myArr.join("||||"))
    Note that Array is a Top Level Class. So for Sprite (or other classes inside packages) you need to use "flash.display.Sprite" as the fully qualified Class name.
    See: http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/utils/package.html#getDefinitionByName()

Maybe you are looking for

  • Macbook Pro Boot Issue, White Screen with Apple

    Having a similar issue with my macbook pro. When I press the power button, a white screen appears with an apple icon in the middle and a small cirle on the bottom that is like a timer. I thought that the computer might be downloading something, but I

  • Fill Field 'Header text' in FB01

    Hi, Now: documents (FB03) in field header text have date from documents date from invoices. I would like to have another date which automatic print here. For example one date 01.01.2000 . Can change it in tcode or it's more advance setup. Thanks

  • Best Practice - Software Simulation Projects

    Hello, I'm beginning a new software simulation project where I will need to switch back and forth between demonstration mode and training mode.    The talent will explain and demonstrate the software, then ask the learner to click or type to get to t

  • The requested time out error

    Hi All, We have completed developing application and now tries to validate and distribute my application to apple app store. But i am getting error during validation and distribute the application, giving the error "the request timed out". Its happen

  • How do i get all the apps that i had before upgrading my ipad

    how do i get all the apps that i had before upgrading my ipad