Passing split array to function

Anyone know how to pass an array to a function as seperate
parameters i.e
_array = [param1,param2,param3]
functionToCall(param1,param2,param3)
instead of: functionToCall(_array[0],_array[1],_array[2]);
of having to go
var1 = _array[0];
var2 = _array[1];
var3= _array[2];
functionToCall(var1,var2,var3)
Cheers, burnside

DCIBurnside,
> Marco Mind wrote:
> Can't you just pass the array and indexs as a second
array?
That would only work if the desired function is written to
accept two
parameters formatted as arrays. DCIBurnside could certainly
write an
intermediary function, I suppose; but for that effort, it
would be just as
easy to pass in the parameters as already shown:
functionToCall(_array[0],_array[1],_array[2]);
Check out the methods of the Fuction class -- in particular
Function.apply() -- which might be exactly what DCIBurnside
is looking for.
David Stiller
Co-author, ActionScript 3.0 Quick Reference Guide
http://tinyurl.com/dpsAS3QuickReferenceGuide
"Luck is the residue of good design."

Similar Messages

  • Passing 3d arrays to functions in C

    So.. I have a certain char array[8][3][30], declared as ***array, and allocated as the program progresses. I'd like to pass that to an external function, but GCC pukes out warnings that the type case isn't right, and anytime I access it in the function, it segfaults (basically, it doesn't pass properly).
    my function prototype:
    int parse_table(char ***table);
    and code to pass it:
    parse_table(table);
    anyone knowledgable on this?

    tardo wrote:main()
    char ***table;
    parse_table(table);
    use_table(table);
    parse_table(char ***table)
    // read one value from file
    // determine other two values from file input
    // allocate memory depending on values (varies with file input)
    use_table(char ***table)
    // programming homework (probably a tree)
    AHEM, so, I actually bothered to read this properly this time . If this is actually how you have your code structured, this is definitely a problem. Think about this: "table" is of type "char ***", correct? parse_table takes a type "char ***"... you have pass-by-value semantics here. So, essentially, parse_table will receive a COPY of an unitialized memory location. You will then set this local copy to the return of malloc (e.g. something lik table = malloc(/*stuff*/)). However, this is not affecting the table seen in main()! Essentially, you should have something like:
    int main() {
    char ***table = parse_table();
    /* rest of main */
    char *** parse_table() {
    /* Stuff that mallocs into local_table pointer */
    return local_table;
    Where, you malloc the stuff in parse_table, and return that pointer. Alternatively (and painfully), you could do something weird like:
    int main() {
    char ***table;
    parse_table(&table);
    /* rest of main */
    void parse_table(char ****table) { /* Note: four "asterisks", not three! */
    /* malloc evilness in here, with something like (*table) = malloc(/* stuff */) */
    (Don't do this, it's ugly and unnecessary)
    Just to be completely pendantic, check it this sample code I whipped up:
    #include <stdlib>
    #include <stdio>
    void evil_and_wrong(char *f) {
    printf("Memory location we'd allocate to (evil_and_wrong): %un", &f);
    f = (char*)malloc(5*sizeof(char));
    f[0]='p';
    void my_alloc_f(char **f) {
    printf("Memory location we'd allocate to (my_alloc_f): %un", f);
    (*f) = (char*)malloc(5*sizeof(char));
    (*f)[0]='p';
    char * nicer_my_alloc_f() {
    char *local_f = (char*) malloc(5*sizeof(char));
    local_f[0]='p';
    return local_f;
    int main() {
    char *f;
    printf("ACTUAL Memory location: %un", &f);
    evil_and_wrong(f);
    // We won't try anything with "f" here, since it'll segault...
    my_alloc_f(&f);
    printf("Should see: %un", 'p');
    printf("See: %un", f[0]);
    free(f);
    f = nicer_my_alloc_f();
    printf("See: %un", f[0]);
    free(f);
    return 0;
    Look at the outputted memory locations, and think about the fact you're trying to store the address of the allocated memory...

  • How do I pass an array of structs to a C function using the dll flexible prototype adapter?

    What I want to do is pass into a C dll function a variably sized Array of structs of type TPS_Data. My Code compiles but when I run it in TestStand, I get an error -17001; Program Error. "Cannot allocate 0 size buffer Error in parameter 2, 'OpenFrdData'."
    I've allocated the Array of structs, and all of the information is there before I call my function, so is it my prototype? Or am I asking too much of the DLL Flexible Prototype Adapter to pass an Array of Structs?
    I can pass in a single struct of type TPS_Data and that works, but not an array.
    Here's the relevent code:
    typedef struct TPS_DATA
    char Report_Number[256];
    char System_Name[256];
    char Open_Date[256];
    char UUT_Part_Number[256];
    char UUT_Serial_Number[256];
    char UUT_Name[256];
    char Open_Employee_Name[256];
    char Open_Employee_Number[256];
    char Close_Employee_Name[256];
    char Close_Employee_Number[256];
    char Close_Date[256];
    } TPS_Data;
    typedef struct TPS_DATA_ARRAY
    TPS_Data DataRecord;
    } TPS_DataArray;
    long __declspec(dllexport) __stdcall OpenDialog (CAObjHandle Context, TPS_DataArray *TpsData[], const char *psFaultStr, char *sComments, const int nCount);

    OK,
    I can pass the data to the DLL function, using the following types:
    typedef struct StringArrayType
    char string[10][256];
    } StringArray;
    typedef struct MultiStringArrayType
    StringArray Record[10];
    } MultiStringArray;
    void __declspec(dllexport) __stdcall ATP_TestStructPassing(StringArray Strings)
    return;
    void __declspec(dllexport) __stdcall ATP_TestMultiStructPassing(MultiStringArray *Strings)
    return;
    But when the MultiStruct function Exits, TestStand reports an Error:
    -17501 "Unexpected Operating System Error" Source: 'TSAPI'
    There doesn't seem to be a way around this, and once the error occurs, I have to force quit TestStand. I've included the sequence file, and the dll code can be compiled from the fun
    ctions shown above.
    Any thoughts on how to get around this error would be greatly appreciated.
    Attachments:
    StructArrayPassing.seq ‏16 KB

  • How to pass an array to a function from a SELECT statement

    Hi all. I have a problem with passing an array to a function directly from a SELECT statement.
    Here is what I want. If I have a function
    function AAA(arrayVar <ArrayType>) return number;
    I want to be able to call this function this way
    select AAA((2,3,4))
    from dual
    or this way
    select AAA((10,12))
    from dual
    In other words I want to be able to pass an arbitrary number of numbers to the function. And I want this to work in a SELECT statement.
    Does anyone have any ideas how to implement this? What <ArrayType> should I use?(I've read about VARRAY, nested tables in the Oracle documentation but as far as I've understood these array types are meant to be used within PL/SQL blocks).
    I found only this http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:208012348074 through Google but it didn't help me.
    Thank you in advance.

    > What <ArrayType> should I use?
    SQL data types - as 3360 showed above. You cannot use PL/SQL structures and user types in the SQL Engine.
    You can however use all SQL structures and types in PL/SQL.
    Arrays in SQL is created as collection type - basic o-o. The collection type (or class) serve as a container for instantiated objects or scalar type.
    This is covered in detail in [url http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14260/toc.htm]
    Oracle® Database Application Developer's Guide - Object-Relational Features

  • Passing array to function

    I'm trying to use the code below to convert an array of numbers in scientific notation to standard notation. The conversion code itself works, but when trying to pass an array of numbers to the function, it's not receiving anything. Returning the "theArray" array gives me an empty array. What am I doing wrong?
    Here's the applicable code:
    set convertedArray to my deScience(myArray)
    on deScience(theArray)
    set s to 1
    set deScienceArray to {}
    repeat length of theArray times
    set testNumber to my round_truncate(item s of theArray, 6)
    if testNumber contains ".-" then
    set x to the offset of "." in testNumber
    set partOne to characters 1 thru (x) of testNumber as string
    set partTwo to characters (x + 2) thru length of testNumber as string
    set the combinedNumber to partOne & partTwo
    set s to s + 1
    set end of the deScienceArray to testNumber
    end if
    end repeat
    return the deScienceArray
    end deScience

    It would help if you included an example of the input values you're passing in (e.g. are you passing in text objects or real numbers?
    For example, unless your round_truncate() handler takes care of the coercion, the following would likely return different results:
    set myArray to {"1.23456E+5"} -- text object
    set myArray to {1.23456E+5} -- scientific notation
    set myArray to {123456.0} -- real number

  • Passing Arrays to function

    In my main function, I have created a class array of Players[3]. In the function I pass this array of Players to another class function that may or may not change the size of this array (which I may be doing incorrectly). This is console game of Blackjack hardcoded to 3 players for now, but when one goes out, I would like to reset the amount of Players. Currently in another ckass function, I check to see if they have any money left. If they don't, I create a new Players array with one less than the original then do a System.arraycopy(newArray, 0, originalArray, 0, newSize), then I set newArray back equal to originalArray. Oddly, though, when I leave this function and go back to main, the contents of the original array have changed, but the size is still 3. I would expect it to be one less now.
    Eric

    There is no pass-by-reference in Java. All parameters are passed by value.
    It's just that for object types, what you're passing are references.
    So if you do this:
    public void someMethod(String s) {
      s = "Fred";
    // and in some other method:
    String test = "Barney";
    someMethod(test);
    System.out.println(test);it will print "Barney". You passed a reference in someMethod, then you changed the reference to something else. But all you changed was the local value of that reference. The caller's reference variable value (the variable "test", which has a reference value) is unchanged.

  • Passing multidim array to c function

    Hi all,
    I am very new to JNI, so please excuse if asking something stupid. I want to pass amultidimensional array (double[][]) to a c++ function. The array holds a large matrix for a linear equation system, the c++ function is a solver.
    I can run "Hello World" using JNI, and I can pass a 1-dim double[] Array to a c++ function.
    If changing the native method argument from double[] to double[][], javah produces a c++ header file with jobjectArray as argument type. I don't understand, how to access the array within the c++ code.
    Can anyone give me a tip, how to do it? Most helpfull would be a c++ code line, that fetches an array...
    Thanks a lot,
    Clemente
    The generated header file:
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class Solver */
    #ifndef IncludedSolver
    #define IncludedSolver
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: Solver
    * Method: solve
    * Signature: ([[DI)[D
    JNIEXPORT jdoubleArray JNICALL Java_Solver_solve
    (JNIEnv *, jobject, jobjectArray, jint);
    #ifdef __cplusplus
    #endif
    #endif
    Edited by: Clemente on Oct 15, 2007 2:15 AM
    Edited by: Clemente on Oct 15, 2007 3:37 AM
    Edited by: Clemente on Oct 15, 2007 3:42 AM
    Edited by: Clemente on Oct 15, 2007 3:43 AM

    Finally, I figured to access all dimensions. For the archive and anyone with similar problems:
    Assumed, that the provided jobjectArray is called "array", means the method looks something like:
    JNIEXPORT jdoubleArray JNICALL Java_de_vonmusil_vs_wqn_solver_Solver_solve(JNIEnv *env, jobject ob, jstring path, jobjectArray array) { [...] }
    following snippet lists the first two rows of the array of doubles:
         int j;
         jdoubleArray darray = (jdoubleArray) env->GetObjectArrayElement(array, 0);
         jdouble* first_element = env->GetDoubleArrayElements(darray, NULL);
         for (j=0; j<env->GetArrayLength(darray); j++)
              std::cout << "->" << first_element[j] << std::endl;
         darray = (jdoubleArray) env->GetObjectArrayElement(array, 1);
         first_element = env->GetDoubleArrayElements(darray, NULL);
         for (j=0; j<env->GetArrayLength(darray); j++)
              std::cout << "->" << first_element[j] << std::endl;
    Besides all the casting things, it works this way: A double[][] array is an array (a) of arrays (b). One can get a b-array with env->GetObjectArrayEalement(array, 0);.
    env->GetDoubleArrayElements(darray, NULL); fetches a pointer to the first double value and using the pointerarithmetic pointer[], one can iterate over the whole array.
    Thank you for all your help,
    Clemente
    Edited by: Clemente on Oct 15, 2007 1:26 PM

  • Passing an array as IN parameter to call a function

    I have a function the definition is
    TYPE VAR_VALUE_RECORD IS RECORD(VAR VARCHAR2(100),
                   VALUE VARCHAR2(100));
    TYPE VAR_VALUE_TAB IS TABLE OF VAR_VALUE_RECORD;
    FUNCTION GENERIC_WF(P_MSG_TYPE IN VARCHAR2,P_CDCS_NBR IN VARCHAR2, P_CDCS_SEQ IN VARCHAR2, P_DEBTORID IN NUMBER,
    P_EXTRAS IN VAR_VALUE_TAB) RETURN VARCHAR2;
    I am trying to call this function
    select WF_NOTIFICATIONS_PKG.GENERIC_WF('Manual Debt Establish Notification','2009A13636','001',105195359,'this is a test') from dual
    ERROR at line 1:
    ORA-06553: PLS-306: wrong number or types of arguments in call to 'GENERIC_WF'
    I am getting the above error, how do I pass the array as parameter.
    I will appreciate your help.
    Thnaks

    Hi,
    try this,
    Create OR Replace Package WF_NOTIFICATIONS_PKG Is
       Type VAR_VALUE_RECORD Is Record( VAR   Varchar2(100)
                                      , Value Varchar2(100));
       Type VAR_VALUE_TAB Is Table Of VAR_VALUE_RECORD Index BY Pls_Integer;
       Function GENERIC_WF( P_MSG_TYPE IN Varchar2
                          , P_CDCS_NBR IN Varchar2
                          , P_CDCS_SEQ IN Varchar2
                          , P_DEBTORID IN Number
                          , P_EXTRAS   IN VAR_VALUE_TAB ) Return Varchar2;
    End WF_NOTIFICATIONS_PKG;
    Create OR Replace Package Body WF_NOTIFICATIONS_PKG Is
       Function GENERIC_WF( P_MSG_TYPE IN Varchar2
                          , P_CDCS_NBR IN Varchar2
                          , P_CDCS_SEQ IN Varchar2
                          , P_DEBTORID IN Number
                          , P_EXTRAS   IN VAR_VALUE_TAB ) Return Varchar2 Is
       Begin
          Return ( P_EXTRAS(P_EXTRAS.First).var || ' - ' || P_EXTRAS(P_EXTRAS.First).Value );
       End GENERIC_WF;
    End WF_NOTIFICATIONS_PKG;
    SQL> Declare
      2     v_value_Tab WF_NOTIFICATIONS_PKG.VAR_VALUE_TAB;
      3     v_return    Varchar2(100);
      4  Begin
      5     v_value_Tab(1).var   := 'this is a test 1';
      6     v_value_Tab(1).value := 'this is a test 2';
      7 
      8     v_return := WF_NOTIFICATIONS_PKG.GENERIC_WF( 'Manual Debt Establish Notification'
      9                                                , '2009A13636'
    10                                                , '001'
    11                                                , 105195359
    12                                                , v_value_Tab );
    13 
    14     Dbms_Output.put_line(v_return);
    15  End;
    16  /
    this is a test 1 - this is a test 2
    PL/SQL procedure successfully completedRegards,
    Christian Balz

  • How do you pass an array of characters using the DLL functions

    I have exported C code into my DLL and I want to know how to pass an array of characters using LabVIEW.

    Mont;
    If you want to pass a string from LabVIEW to your dll, and you do NOT change size of the string, you can use a C String pointer (CStr), which is equivalent to (unsigned) char *.
    If you do modify size of the string, pass string as a LabVIEW structure (LStrHandle).
    The example "Passing a Variety of Data Types from DLL to LabVIEW" is an excellent starting point. Also make sure you check the manual "Using External Code in LabVIEW".
    Regards;
    Enrique
    www.vartortech.com

  • Passing an array in a for loop to a procedure

    I am trying to pass an array in a cursor for loop to a procedure which performs a table insert using the array's contents. Somehow I am missing something, or it is not possible. The compile error states: PLS-00306: wrong number or types in call to 'insert_address' I checked to be sure I am creating the arrays in both cases from similar data objects. Both address and work_address_table contain the same 4 columns with the same data types.
    create or replace package work_address as
    FUNCTION populate_address return boolean;
    procedure insert_address(in_address IN work_address_table%ROWTYPE);
    end work_address;
    create or replace package body work_address as
    function populate_address return boolean is
    cursor c1 is
    select 'H' as header,
    street1 as street
    city as city,
    NULL as state
    from address
    where city = 'HANOVER';
    TYPE addressT IS TABLE OF c1%ROWTYPE INDEX BY BINARY_INTEGER;
    rec1 addressT;
    BEGIN
    OPEN c1;
    FETCH c1 BULK COLLECT INTO rec1 LIMIT 500;
    FOR i IN 1..rec1.count LOOP
    rec1(i).state := 'US'
    insert_address(rec1(i));
    exit when c1%notfound;
    END LOOP;
    CLOSE c1;
    return TRUE;
    END populate_address;
    PROCEDURE insert_address(in_address IN work_address_table%ROWTYPE) IS
    BEGIN
    INSERT INTO work_address_table
    VALUES (in_address.header,
    in_address.street,
    in_address.city,
    in_address.state);
    COMMIT;
    END insert_address;
    END work address;
    /

    Both address and work_address_table contain the same 4 columns with the same data types.Are you 100% sure about this?
    SQL> declare
      cursor c1
      is
        select 1 deptno, dummy dname, 'Loc' location from dual;
      type addresst is table of c1%rowtype
        index by binary_integer;
      rec1   addresst;
      procedure p (d dept%rowtype)
      as
      begin
        dbms_output.put_line(d.dname);
      end p;
    begin
      rec1 (1).dname := 'z';
      p (rec1 (1));
    end;
    z
    PL/SQL procedure successfully completed.but changing just the first column of the cursor:
    SQL> declare
      cursor c1
      is
        select 'xy' deptno, dummy dname, 'Loc' location from dual;
      type addresst is table of c1%rowtype
        index by binary_integer;
      rec1   addresst;
      procedure p (d dept%rowtype)
      as
      begin
        dbms_output.put_line(d.dname);
      end p;
    begin
      rec1 (1).dname := 'z';
      p (rec1 (1));
    end;
    Error at line 3
    ORA-06550: line 20, column 3:
    PLS-00306: wrong number or types of arguments in call to 'P'
    ORA-06550: line 20, column 3:
    PL/SQL: Statement ignored

  • How to pass an array which in the jsp to a javascript file

    now i have 2 files: jsp and js(javascript)
    i want pass an array which in the jsp to another file--> js file
    how can i do it ???
    can u give me some related links or some source codes as the references???
    thx

    bcos ....my senior has resigned!!! so i take over his job !!!!!
    depend on the talent and the project ....only that way to implement to whole project !!!!
    but , i had settled it already ....
    it is very simple
    in the middle.jsp
    Collection result = menuManager.getUserRoleMenu(webSessionUser.getGnuserId());
    String menuname[]=new String[110];
    int menucounter=0;
    Iterator vi = result.iterator();
    while(vi.hasNext())
    HashMap hm=(HashMap)vi.next();
    menuname[menucounter]=hm.toString();
    menucounter++;
    int i;
    String tempstr="";
    for(i=0;i<menuname.length;i++)
    tempstr+=menuname[i]+",";
    session.setAttribute("menuname",tempstr);
    %>
    <script language="javascript">
    menu123("<%=tempstr %>");
    </script>
    in the body,js
    function menu123(string123)
    //doing
    so ....through the script --menu123
    i can get the string from jsp to the js!!!!!
    is it very simple, but it spends my 2 days!!!
    i just learn javascript ....about 1 month !!!

  • How to pass an array in Oracle Procedure

    If I have to pass an array as an argument in Oracle Procedure/function. How to do that ??
    For example, I have to pass the names of employess and then for these employess I have to do something in Oracle Procedure.
    Thanks & Regards,
    Vinay

    Hi!
    Here is an example:
    create or replace procedure test
    is
    type v2_itt is table of varchar2(2000) index by binary_integer;
    l_v2 v2_itt;
    procedure test2( pi_v2 v2_itt ) is
    begin
    for i in 1 .. pi_v2.count loop
    dbms_output.put_line( pi_v2(i) );
    end loop;
    end;
    begin
    l_v2(1) := 'name1';
    l_v2(2) := 'name2';
    test2( l_v2 );
    end;
    Regards,
    Andrew Velitchko
    BrainBench MVP for Developer/2000
    http://www.brainbench.com

  • How to pass joint in a function

    hi,
    i want to pass Right Hand joint in a function and want to store last 5 position of joint in an point array. but when i pass the joint as below :-
    Point point = ExponentialWeightedAvg(Joint HandRight)
    it tells that joint is a type not a variable.
    so,
    how can i pass right hand joint and do some calculations.
    thanks !!

    The syntax you wrote is incorrect. As with any programming language, you should be familiar how to write the correct syntax in the language of choice, since that would be a pre-requisite for using the SDK.
    We already provide a BodyBasics sample that demonstrates how you can pass joint information to other functions. The key will be to get the joint position and pass that to the function you want:
    CameraSpacePoint position = joints[JointType.HandRight].Position;
    Carmine Sirignano - MSFT

  • How to pass an array to a subroutine in FXscript?

    Hi,
    I am having problems trying to pass an array to a subroutine in FXscript.  Code segment:
    on TestSub(value x)
    // do stuff
    end
    float i, testarray[256];
    for i = 0 to 255
              testarray[i] = i;
    next
    TestSub(testarray);
    FXscript returns the error "missing close parenthesis".  If TestSub(testarray) is replaced with TestSub(testarray[0]) no error, i.e. if a single value is passed.
    Trying to define the subroutine differently doesn't help, e.g. "on TestSub(value x[255])" or "on TestSub(float x[255])" yields the same error.
    How do you pass an array to an FXscript subroutine?  Or is it not possible?
    Thanks for any clues...

    You are not being quite clear.  If the next frame expects a pointer to a buffer, it cannot be a vi.  Labview has no pointer types.  You must be referring to a Call Library Node which is set up to call a DLL function.  If this is the case, you need to configure the Call Library Node to accept an array of the data type.  Then you can wire the array into the call library node.
    Is this the case, Call Library Node?
    - tbob
    Inventor of the WORM Global

  • Passing an array as parameter from java (java controls) to stored procedure

    Hi,
    I'm using java controls (BEA Weblogic Workshop 8.1) to call a stored procedure and send an array as a parameter to the stored procedure from java. The following code below throws an exception "Fail to convert to internal representation".
    Java code
    import com.bea.control.DatabaseControl.SQLParameter;
    // Here i create the java array
    int[] javaArray={12,13,14};
    //The code below is used to create the oracle sql array for the procedure
    SQLParameter[] params = new SQLParameter[1];
    Object obj0=javaArray;
    params[0] = new SQLParameter(obj0, oracle.jdbc.OracleTypes.ARRAY, SQLParameter.IN);
    // the code below calls the testFunc method in OJDBCtrl.jcx file
    String succ= dbControl.testFunc(params);
    OJDBCtrl.jcx
    * @jc:sql statement="call CMNT_TST_PROC(?))"
    String testFunc(SQLParameter[] param);
    The stored procedure used:
    TYPE SL_tab IS TABLE OF number INDEX BY PLS_INTEGER;
    Procedure cmnt_tst_proc (cmnt_tst sl_tab);
    Procedure cmnt_tst_proc (cmnt_tst sl_tab) is
    BEGIN
    dbms_output.put_line('Hello');
    END;
    I am getting the following exception
    Failure=java.sql.SQLException: Fail to convert to internal representation: [I@438af4 [ServiceException]>
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
    at oracle.jdbc.driver.DatabaseError.check_error(DatabaseError.java:861)
    at oracle.sql.ARRAY.toARRAY(ARRAY.java:210)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7768)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7449)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7837)
    at oracle.jdbc.driver.OracleCallableStatement.setObject(OracleCallableStatement.java:4587)
    at weblogic.jdbc.wrapper.PreparedStatement.setObject(PreparedStatement.java:244)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl._setParameter(DatabaseControlImpl.jcs:1886)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl.getStatement_v2(DatabaseControlImpl.jcs:1732)
    at com.bea.wlw.runtime.core.control.DatabaseControlImpl.invoke(DatabaseControlImpl.jcs:2591)
    at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:377)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:433)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:406)
    at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:249)
    at com.bea.wlw.runtime.jcs.container.JcsContainer.invoke(JcsContainer.java:85)
    at com.bea.wlw.runtime.core.bean.BaseContainerBean.invokeBase(BaseContainerBean.java:224)
    at com.bea.wlw.runtime.core.bean.SLSBContainerBean.invoke(SLSBContainerBean.java:109)
    at com.bea.wlwgen.StatelessContainer_ly05hg_ELOImpl.invoke(StatelessContainer_ly05hg_ELOImpl.java:153)
    Can you please let me know, what i'm doing wrong and how i can pass an array to a procedure/function using java controls.
    Any help will be highly appreciated.
    Edited by: user12671762 on Feb 24, 2010 5:03 AM
    Edited by: user9211663 on Feb 24, 2010 9:04 PM

    Thanks Michael.
    Here's the final code that i used, this might be helpful for those who face this problem
    Java Code
    // Following code gets the connection object
    InitialContext ctx = new InitialContext();
    dataSource = (DataSource)ctx.lookup("<DataSourceName>");
    conn=dataSource.getConnection();
    // Following code is used to create the array type from java
    String query="CREATE OR REPLACE TYPE STR_ARRAY AS VARRAY(3) OF NUMBER";
    dbControl.runTypeQuery(query);
    // Following code is used to obtain the oracle sql array as SQLParameter
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor("<schemaName>.STR_ARRAY", conn);
    Object[] elements = new Object[3];
    elements[0] = new Integer(12);
    elements[1] = new Integer(13);
    elements[2] = new Integer(14);
    oracle.sql.ARRAY newArray = new oracle.sql.ARRAY( desc, conn, elements);
    SQLParameter[] params = new SQLParameter[1];
    params[0] = new SQLParameter(newArray, oracle.jdbc.OracleTypes.ARRAY, SQLParameter.IN);
    String succ= dbControl.testFunc(params);

Maybe you are looking for

  • Opening a link from one iframe into another

    Hello, I have a web template in which there are three iframes. Each Iframe has a different web template embedded in it. I want to open a link present in one iframe into another. Example: iframe 1 (id: left) contains a link google dot com (or a link t

  • Error in smartform

    hai,    i created a smartform to display data from vbap. i looped the internal table t_tab. but when go for print preview values are not printing but field names are displaying like &w_tab-vbeln& &w_tab-posnr& &w_tab-netwr& i followed thw link <link

  • After data recovery, HD is a mess

    I recently had my hard drive die on my powermac G5 and my Clickfree external backup hard drive also failed. Sob! I sent the dead drive to a data recovery service and they say they restored everything. Send back my restored data on an external hard dr

  • Pricing in PO without Invoice

    Dear Experts, Do you know any standard way to activate the pricing in PO which is not relevant for invoicing?? I will appreciate all the help. Regards, Sylwia.

  • Return Item Categories

    HI All, I am creating a return sales order for a non configurable material. The item category is REN (standard item category) which is being determined. When i am checking the sales order for any incompleteness system gives and information message as