Axis returning array issue

Hi! I'm trying to generate a WSDL from a .java file with the plug-in for Eclipse "Code Generator Wizard - Eclipse Plug-in", available from http://ws.apache.org/axis2/tools/index.html
The method that I'm trying to generate has the following signature :
public String[][] translateConceptsToTerms(String[] conceptURIs, String lang)
So the return type is two dimensional array of Strings. The thing is that the tool generates the following lines in the WSDL :
<xs:element name="translateTermsToConceptsResponse">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="return" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
which after that with the tool for generating Java code from WSDL generates as return type ONE dimensional array! (the second tool is from the same plug-in as the first one)
My question is if AXIS2 supports this return type, or there is some problem with the tools ... or something else? If somebody has any idea ...
sharath chetty

Hi,
Thanks for the info. A co-worker of mine has got this working. When I try the same thing, I am getting the error.
On comparing the co-worker's and mine XML files, I found that the working example contains following attribute:
ElemType
Whereas my XML file doesn't contain this entry. What do I have to do to get this entry in the XML file - I checked all options in the VO wizard and was unable to find anything.
Please suggest -- thanks in advance!!

Similar Messages

  • Invoking stored procedure that returns array(oracle object type) as output

    Hi,
    We have stored procedures which returns arrays(oracle type) as an output, can anyone shed some light on how to map those arrays using JPA annotations? I tried using jdbcTypeName but i was getting wrong type or argument error, your help is very much appreciated. Below is the code snippet.
    JPA Class:
    import java.io.Serializable;
    import java.sql.Array;
    import java.util.List;
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import org.eclipse.persistence.annotations.Direction;
    import org.eclipse.persistence.annotations.NamedStoredProcedureQuery;
    import org.eclipse.persistence.annotations.StoredProcedureParameter;
    * The persistent class for the MessagePublish database table.
    @Entity
    @NamedStoredProcedureQuery(name="GetTeamMembersDetails",
         procedureName="team_emp_maintenance_pkg.get_user_team_roles",
         resultClass=TeamMembersDetails.class,
         returnsResultSet=true,
         parameters={  
         @StoredProcedureParameter(queryParameter="userId",name="I_USER_ID",direction=Direction.IN,type=Long.class),
         @StoredProcedureParameter(queryParameter="employeeId",name="I_EMPLOYEEID",direction=Direction.IN,type=Long.class),
         @StoredProcedureParameter(queryParameter="TEAMMEMBERSDETAILSOT",name="O_TEAM_ROLES",direction=Direction.OUT,jdbcTypeName="OBJ_TEAM_ROLES"),
         @StoredProcedureParameter(queryParameter="debugMode",name="I_DEBUGMODE",direction=Direction.IN,type=Long.class)
    public class TeamMembersDetails implements Serializable {
         private static final long serialVersionUID = 1L;
    @Id
         private long userId;
         private List<TeamMembersDetailsOT> teamMembersDetailsOT;
         public void setTeamMembersDetailsOT(List<TeamMembersDetailsOT> teamMembersDetailsOT) {
              this.teamMembersDetailsOT = teamMembersDetailsOT;
         public List<TeamMembersDetailsOT> getTeamMembersDetailsOT() {
              return teamMembersDetailsOT;
    Procedure
    PROCEDURE get_user_team_roles (
    i_user_id IN ue_user.user_id%TYPE
    , o_team_roles OUT OBJ_TEAM_ROLES_ARRAY
    , i_debugmode IN NUMBER :=0)
    AS
    OBJ_TEAM_ROLES_ARRAY contains create or replace TYPE OBJ_TEAM_ROLES_ARRAY AS TABLE OF OBJ_TEAM_ROLES;
    TeamMembersDetailsOT contains the same attributes defined in the OBJ_TEAM_ROLES.

    A few things.
    You are not using a JDBC Array type in your procedure, you are using a PLSQL TABLE type. An Array type would be a VARRAY in Oracle. EclipseLink supports both VARRAY and TABLE types, but TABLE types are more complex as Oracle JDBC does not support them, they must be wrapped in a corresponding VARRAY type. I assume your OBJ_TEAM_ROLES is also not an OBJECT TYPE but a PLSQL RECORD type, this has the same issue.
    Your procedure does not return a result set, so "returnsResultSet=true" should be "returnsResultSet=false".
    In general I would recommend you change your stored procedure to just return a select from a table using an OUT CURSOR, that is the easiest way to return data from an Oracle stored procedure.
    If you must use the PLSQL types, then you will need to create wrapper VARRAY and OBJECT TYPEs. In EclipseLink you must use a PLSQLStoredProcedureCall to access these using the code API, there is not annotation support. Or you could create your own wrapper stored procedure that converts the PLSQL types to OBJECT TYPEs, and call the wrapper stored procedure.
    To map to Oracle VARRAY and OBJECT TYPEs the JDBC Array and Struct types are used, these are supported using EclipseLink ObjectRelationalDataTypeDescriptor and mappings. These must be defined through the code API, as there is currently no annotation support.
    I could not find any good examples or doc on this, your best source of example is the EclipseLink test cases in SVN,
    http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/plsql/
    http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/customsqlstoredprocedures/
    James : http://www.eclipselink.org

  • URGENT   HELP::: returning array of non built in datatypes

    Folks,
    I am trying to implement webservices in weblogic7.0 sp2. We have written a simple
    class(say ClassA) which uses another bean as a user defined data type(ClassB implements
    serializable). I am able to create a webservice if one of the method in ClassA
    returns the object of classB.I am getting an error while creating the web-services.xml
    file using ant tool if same method in ClassA returns array of ClassB.It says
    corresponding type is not found in the types.xml. I created types.xml using ant
    tool too.
    Does weblogic7.0 SP2 support returning array of objects in webservices?
    Any suggestions and immediate response is highly appreciated.
    Thanks,
    Kamal.

    Bruce,
    You understand the question correctly..Thanks for the help... it works now.
    Thanks,
    Kamal.
    Bruce Stephens <[email protected]> wrote:
    Hi Kamal,
    If I understand your question correctly, yes, you should be able to do
    this. You will need to create your own implementation of the
    javax.xml.rpc.holders.Holder interface. See:
    http://edocs.bea.com/wls/docs70/webserv/implement.html#1054236 for
    details.
    If that's not what you are asking, could you post a simple test case?
    HTHs,
    Bruce
    BTW, for URGENT issues, please use our excellent support folks:
    http://support.bea.com
    [email protected]
    kamal wrote:
    Folks,
    I am trying to implement webservices in weblogic7.0 sp2. We have writtena simple
    class(say ClassA) which uses another bean as a user defined data type(ClassBimplements
    serializable). I am able to create a webservice if one of the methodin ClassA
    returns the object of classB.I am getting an error while creatingthe web-services.xml
    file using ant tool if same method in ClassA returns array of ClassB.Itsays
    corresponding type is not found in the types.xml. I created types.xmlusing ant
    tool too.
    Does weblogic7.0 SP2 support returning array of objects in webservices?
    Any suggestions and immediate response is highly appreciated.
    Thanks,
    Kamal.

  • Please help how to get return array from rpg program on java code?

    Hi
    I have created a rpg program that returns 2 parameter 1 is the id and another one is list of array, when I called this program I passed two programparameter from my java code (see the code below) but when i checked what value would be return it is returned only first value of array. how will i get all array values ?
    please suggest me regarding this issues I amn't so much aware on java & AS400.
    try
    ProgramParameter[] parmList = new ProgramParameter[2];
    AS400Text p1 = new AS400Text(10);
    AS400Text p2 = new AS400Text(30);
    try
    parmList[0] = new ProgramParameter(10);
    parmList[1] = new ProgramParameter(30);
    parmList[0].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[1].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[0].setInputData(p1.toBytes("Pune"));
    parmList[1].setInputData(p2.toBytes(" "));
    catch(Exception ex)
    ProgramCall pgm = new ProgramCall(o);
    pgm.setProgram("/QSYS.LIB/XXX/XXX.PGM",parmList);
    if (pgm.run())
    byte s[] = parmList[1].getOutputData(); // HERE I got only first value of returning array.
    parmList[1].getOutputDataLength();
    //String sts = ((String) (new AS400Text(10,o).toBytes(s[0])));
    else
    AS400Message[] messageList = pgm.getMessageList();
    for (int msg = 0; msg < messageList.length; msg++) {
    catch(Exception ex)
    AS400Message[] messageList = null;
    finally
    o.disconnectAllServices();
    Reply With Quote

    Try this :
    try
    ProgramParameter[] parmList = new ProgramParameter[2];
    AS400Text p1 = new AS400Text(10);
    AS400Text p2 = new AS400Text(30);
    AS400Array arrP2 = new AS400Array(p2, 4);
    try
    parmList[0] = new ProgramParameter(10);
    parmList[1] = new ProgramParameter(30);
    parmList[0].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[1].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[0].setInputData(p1.toBytes("Pune"));
    parmList[1].setInputData(arrP2.toBytes({"","","",""}));
    catch(Exception ex)
    ProgramCall pgm = new ProgramCall(o);
    pgm.setProgram("/QSYS.LIB/XXX/XXX.PGM",parmList);
    if (pgm.run())
         Object[] objArr =  (Object [])arrP2.toObject( parmList[1].getOutputData() );
         for(int i =0; i<objArr.length;i++){
                System.out.println( " SKU " + i +" : " + objArr.toString());
    else
    AS400Message[] messageList = pgm.getMessageList();
    for (int msg = 0; msg < messageList.length; msg++) {
    catch(Exception ex)
    AS400Message[] messageList = null;
    finally
    o.disconnectAllServices();

  • Stored Procedure: Function returns Array

    I was just wondering if following scenario is possible in a stored procedure.
    I have a package, which includes 4 different functions and 1 procedure. Procdure uses ref cursor to return values in my reporting tool. What I am trying to do is to write a function which takes input and return array of varchar. Something like..
    Package ABC
    Function student_classes (student_no in Varchar2) return [array]
    begin
    select class_nbr into [array]
    from student_table
    where student_nbr = student_no;
    return [array];
    end student_classes;
    procedure students_info (rpt_cursor IN OUT rpt_type)
    begin
    OPEN rpt_cursor FOR
    select
    student_name,
    student_nbr,
    student_address,
    student_classes (student_nbr) --returns array
    from student_table;
    end student_info; --end of procedure
    end abc; --end of pacakge.
    I used [array], as I am ont sure how to define (syntax) it in spec part of package or in body. I will really appreciate if someone could help me with this function.
    Thank you

    Thanks for the reply Tonguc Y.
    I declared an array in my package declaration
    CREATE OR REPLACE PACKAGE rpt_TESTING_pkg
    AS TYPE rpt_type IS REF CURSOR;
         TYPE DIAGARRAY IS VARRAY(20) OF VARCHAR2(6);
         FUNCTION DIA_CODES (MNO IN VARCHAR2) RETURN DIAGARRAY;
         PROCEDURE member (rpt_cursor IN OUT rpt_type);
    END rpt_TESTING_pkg;
    but then when I try to use it in my function it gives me error that I should declare DIAGARRAY.
    CREATE OR REPLACE PACKAGE BODY rpt_TESTING_pkg
    as
    FUNCTION DIA_CODES (MNO IN VARCHAR2)
                   RETURN DIGARRAY AS diags DIGARRAY;
    begin
    <sql block>
    end dia_codes;
    end rpt_TESTING_pkg;
    Any suggestions.

  • SOAP Webservice returns Array - how to setup Xcelsius?

    Hello,
    after a lot of tests I have recognized that Xcelsius is not able to handle Webservices which return arrays with an undefined size. So I edited the schema file in the way that the size is defined.
    Here is an extract of the schema file:
    <xsd:sequence>
                <xsd:element name="row0" type="tns:Row" maxOccurs="10" minOccurs="10" ></xsd:element>
    </xsd:sequence>
    With that configuration Xcelsius is able to import the wsdl. But the preview window is showing only one Row Folder, I have excpected "10".  My question is, is my config the right way to handle arrays with Xcelsius and when it is, how I have to set up the range in the Excel Map to make the data avaiable???
    Thank you in advance.
    Best regards,
    Conrad

    Here is an example, you can compare what is different. From the look of it the recipient info is missing from yours. Does it say which INI option is missing when you get an error?
    <doPublishRequest xsi:type="doPublishReq_Import" xmlns="http://webservices.docucorp.com/ewps/schema/2005-12-01">
            <LibraryId>CONFIGNAME</LibraryId>
            <DistributionOptions xsi:type="DistributionOptions_ADHOC" source="ADHOC">
              <Priority>REALTIME</Priority>
              <Channel xsi:type="Channel_IMMEDIATE">
                <PublishType>PDF</PublishType>
                <DistributionType>IMMEDIATE</DistributionType>
                <Disposition location="ATTACH" />
                <Recipient name="ORIGINAL">
                  <Props>
                    <Prop name="" />
                  </Props>
                  <Copies />
                  <Story StoryName="" id="" alias="" />
                </Recipient>
              </Channel>
            </DistributionOptions>
            <SourceType>IMPORT</SourceType>
            <Import>
              <ImportFile xsi:type="ImportFile_ATTACH" d6p1:contentType="" location="ATTACH" xmlns:d6p1="http://www.w3.org/2005/05/xmlmime">O05hdXRpbH.......</ImportFile>
            </Import>
          </doPublishRequest>

  • Urgent- returnable packaging issue

    Hi guys,
    am working on returnable packaging issue
    Scenario:If the customer does not returns the preslings then sales order is created for presling and issued to customers with proper invoicing
    am creating a sales order with order type CLN(customised for returnable packaging) and i have give material with qty 1, immediately the system is taking me to availability overview screen where it shows the following.
    Confirmed quantity: 0
    Dely proposal: Not possible.
    i have checked for material in MMBE and see the stock is much sufficient. y am i getting this? please answer immediately.
    thanks in advance.
    kumar.

    Hi pathik,
    the system is already configured and i have to give UAT to the users. i have done according to what UAT says. now plz suggest me what i should i do in this scenario? moreover, shld i use two line items i mean the main item and also the sub item? this is the first time am working on returnable packating so plz help me in as detail as possible.
    u can also plz send me the doc with screen shots(if possible) to this id
    [email protected]
    thanks in advance.
    kumar

  • How to return array of String to a java program.! ??

    Hi All,
    I am new to JNI programming. so trying with simple example. I am having one problem. I have one array of String in my Java program. I want to reverse all the elements in this array and want back this new array in the same form i.e. array of string. So how can I do this ??
    Please guide me.....
    The function of defination of array in my java code is
    public native String[] getReverseStringArray(String[] arrString);
    where as my array is like:
    String[] arrStr = {"one", "two", "three", "four", "��������","�c��","�J�^�J�i"};
    and I am calling function in C file like:
    arrStr = employee.getReverseStringArray(arrStr);
    and the function defination in my c file is
    JNIEXPORT jobjectArray JNICALL
    Java_Emp_getReverseStringArray (JNIEnv *env, jobject obj, jobjectArray arr)
    // some code will come here......
    So can anybody tell me how to do this ??
    Thanx in advance...
    Pandurang
    [email protected]

    Hi,
    this is quite simple. Here an example function that works like this:
    JNIEXPORT jobjectArray JNICALL Java_cadagent_ugopen_UgAssembly_jni_1getStructure
    (JNIEnv *env, jclass cls, jstring part)
    jobjectArray retvals = NULL;
    jstring j_val = NULL;
    int child_count = 5;
    /* initialize return array */
    j_val = (*env)->NewStringUTF(env, "");
    retvals = (*env)->NewObjectArray(env, child_count, (*env)->FindClass(env, "java/lang/String"), j_val);
    for (i=0;i<child_count;i++)
    j_val = (*env)->NewStringUTF(env, "some text");
    (*env)->SetObjectArrayElement(env, retvals,i, j_val);
    return retvals;
    Hope this answers you question.

  • How to return array of object

    public class A{
    public class B{
    publc C[] sample()
    int i=0;
    ResultSet rset = s.executeQuery("select name, id  from emp ");
    while(rs.next()){
    name = rset.getString("nam");
    id = rset.getInt("id");
    c.setName(name )
    c[i].setId(id)
    return c[]
    public class C{
    // here i have getter and setter metod for name & id
    When I try to return the object c[]..i am getting "cannot conver from C to C[]".
    Can u pls help me, how to return array of object and how to get name and id values in other class using this array object
    Thanks for ur help

    public class Starting{
    public long empID;
    Data data = new Data();
    Value[] value;
    int count = 0;
         public static void executeDe(){
              value = new Value[100]
              try{
                     data.getDetails()
                     processDetails(value);
                   }catch(Exception e){e.printStackTrace();}
         public static void processDetails(Value[] value){
         count = data.i;
              int i;
              for(i=0;i<count;i++){
                  empID=value.getempID(); \\ here i am not getting all values..... am getting only last value of the array
    public class Data{
    public long empID;
    public int i=0;
    static Value[] value = new Value[100];
    public static Value[] getDetails(){
    Connection con=null;
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con=DriverManager.getConnection("jdbc:oracle:thin:@" + hostname + ":1521:" + sid, user, password);
    System.out.println(" conn " + con);
    System.out.println("");
    Statement s=con.createStatement();
    try{
         ResultSet rset = s.executeQuery("select EMPID from Employee ");
         while(rset.next()){
    empID = rset.getLong("EMPID");
    value[i].setCycleID(cy_i);
    i++;
         rset.close();
         con.close();
    }catch (SQLException sqle){sqle.printStackTrace();}
         finally{
              try{
              s.close();
         con.close();
              }catch(SQLException e){e.printStackTrace();}
    catch(Exception e){e.printStackTrace();}
    return value;
         public class Value {
         public static long cycleID;
              public static void setempID(long empID) {
                   Value.empID = empID;
              public static long getempID() {
                   return empID;
    This is my actual code..... I am able to set the values in Value class from Data class using getDetails() method, which is returning array of value object.
    In Starting class, I am trying to get values using value[i].. i am getting last value of the array. This is my actual problem... here i want to get all values.
    Please help me how to resolve this.

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

  • Returning material issue

    Hi,
    I have configured standar process for material issues with services rule also, but I need to know the standar process
    in order to returning material (issue by mistake for example).
    There is an indicator in report NMCOL where it suppose used to bring canceled consumptions, but where do we
    cancel consumptions? (standar only please).
    Best regards.

    Hello Milasanz,
    To be able to reverse/cancel a material consumption in IS-H, an appropriate good issue must be reversed/canceled. To cancel a good issue you must use, for example, the following MM t-code: MBST - Cancel/Reverse. It is the logic, BUT actually once you cancel a good issue, a system still issues an error message when you try to cancel a material consumption (it is wrong behavior of SAP). We've written to SAP about the mistake.
    To cancel a material consumption, you must use t-code NMMC1.
    Regards,
    Alexander.

  • Return array of chars

    hi, i'm from Brasil.
    i make a code which use JNI and call a function in C. The function in C print all oppeneds window's names.
    but i want whick the function in C return array of char with the names of the windows.
    //code in java
    public class WindowList {
         private native void listAllWindows();
         public static void main(String[] args) {
              WindowList wl = new WindowList();
              wl.listAllWindows();
         static{
              System.loadLibrary("WindowList");
    //code in C
    #include <windows.h>
    #include <stdio.h>
    #include "WindowList.h"
    JNIEXPORT void JNICALL Java_WindowList_listAllWindows(JNIEnv *env, jobject obj)
        char vetor[50][256];      //i want return this array.
        int i = 0;
        HWND janela = NULL;
        janela = GetDesktopWindow();
        janela = GetWindow(janela, GW_CHILD);
        while(janela != NULL){
            if(IsWindowVisible(janela)){
                SendMessage(janela,WM_GETTEXT,256,(LPARAM)vetor);
    printf("%s\n", vetor[i]);
    i++;
    janela = GetWindow(janela, GW_HWNDNEXT);
    how return the array of chars?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    souarte wrote:
    but i want whick the function in C return array of char with the names of the windows. I doubt that.
    What you want is to return an array of strings.
    Conceptually it is the same as if you were doing it in java.
    - Get a size
    - Create the array with that size
    - Iterate through the array and for each index...
    ....-Create a string with data
    ....-Assign to the array.
    Naturally it is going to take a lot more code to do this in C than in java.

  • Call stored function return array

    Hi all,
    I have a function as follow:
    create or replace TYPE string_table IS TABLE OF VARCHAR2(2000);
    create or replace TYPE ARRAYTYPE is VARRAY(20) OF VARCHAR2(30);
    create or replace FUNCTION getEmpArray(s varchar2, t varchar2, st string_table) RETURN ARRAYTYPE AS
    l_data ARRAYTYPE := ARRAYTYPE();
    BEGIN
    l_data.extend; l_data(l_data.count) := s; l_data.extend; l_data(l_data.count) := t; l_data.extend; l_data(l_data.count) := st(1); RETURN l_data;
    END;
    I want to call this function by StoredFunctionCall
    code:
    StoredFunctionCall fun = new StoredFunctionCall();
    fun.setProcedureName("getEmpArray".toUpperCase());
    Object[] arr = new Object[]{"aa", "fgfg", "bbb"};
    ArrayDescriptor arrDescriptor =
    ArrayDescriptor.createDescriptor("string_table".toUpperCase(),
    connection);
    ARRAY arrayToPass = new ARRAY(arrDescriptor, connection, arr);
    fun.addUnamedArgumentValue("a");
    fun.addUnamedArgumentValue("b");
    fun.addUnamedArgumentValue(arrayToPass);
    fun.setResult("FUNCTION_RESULT"); // for get result by this name
    Vector<DatabaseRecord> list = session.executeSelectingCall(fun);
    But Exception
    PLS-00382: expression is of wrong type
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Error Code: 6550
    Call: BEGIN ? := GETEMPARRAY(?, ?, ?); END;
         bind => [=> FUNCTION_RESULT, a, b, oracle.sql.ARRAY@21fbc01]
    Please help me
    Edited by: fbg on 21:52 26-04-2010

    A few issues,
    1 - JDBC does not support the PLSQL TABLE type, you must use a VARRAY type, or wrap the TABLE function call in a function that takes a VARRAY.
    TopLink also has support for PLSQL types in its PLSQLStoredProcedureCall class, but no support is currently offered for StoredFunctions.
    You can't pass the VARRAY type for the TABLE argument.
    2 - Your function returns a VARRAY, so you need to define this type in the StoredFunctionCall result.
    We don't currently expose the API to set a Array type for the result, so you would need to access the call's first parameter directly, or use a StoredProcedureCall (and convert your function to a procedure).
    You may also wish to investigate returning a cursor from a stored procedure instead of the varray.
    You could also access the JDBC connection directly and perform the call using JDBC code.
    Feel free to log these issues in EclipseLink.
    James : www.eclipselink.org

  • Returning array of values from a PL/SQL stored procedure

    I try to run the following example, always happen errors: Run-time error'91' Object variable or With block variable not set.(in line: Set myRS.Source = myCmd1 and Set myRS.Source = myCmd2) Who can tell me where is wrong? I check variable, all set.
    Option Explicit
    Dim myCnn As ADODB.Connection
    Dim myCmd1 As ADODB.Command
    Dim myCmd2 As ADODB.Command
    Dim myRS As ADODB.Recordset
    Dim myConnStr As String
    Dim mySQL As String
    Dim inputssn As Long
    Private Sub cmdGetEveryone_Click()
      Dim myLine As String
      Set myRS.Source = myCmd1
      myRS.Open
      myLine = ""
      While Not myRS.EOF
          myLine = myLine & myRS.AbsolutePosition & " " & _
                   myRS(0) & ", " & myRS(1) & ", " & myRS(2) & vbCrLf
          myRS.MoveNext
      Wend
      MsgBox myLine
      myRS.Close
    End Sub
    Private Sub cmdGetOne_Click()
      Set myRS.Source = myCmd2
      inputssn = InputBox("Enter the SSN you wish to retrieve:")
      myCmd2(0) = inputssn
      myRS.Open
      If myRS.RecordCount = 0 Then
         MsgBox "No data found"
      Else
         MsgBox "Person data: " & myRS(0) & ", " & myRS(1) & ", " & myRS(2)
      End If
      myRS.Close
    End Sub
    Private Sub Form_Load()
      'Using an "On-the-fly" nameless ODBC connection
      'Replace <User ID>, <Password>, and <Server> with the
      'appropriate parameters.
      '  myConnStr = "UID=*****;PWD=*****;driver=" _
      '         & "{Microsoft ODBC for Oracle};SERVER=dseOracle;"
      ' myConnStr = "UID=CSUPerson;pwd=euclid;driver={Microsoft ODBC for Oracle};SERVER=company;"
      'you may also use a named connection DSN such as "myOracleODBC" as follows
      myConnStr = "user id=csuperson;password=euclid;DSN=myOracleODBC;"
      Set myCnn = New ADODB.Connection
      With myCnn
          .ConnectionString = myConnStr
          .CursorLocation = adUseClient
          .Open
      End With
      'the entry RESULTSET 99 indicates the arguments (ssn, fname, lname)
      'are arrays of up to 99 cells each.
      'The binding vars (ssn, fname, lname) should be retrieved in VB using a recordSet
      mySQL = "{call packperson.allperson({RESULTSET 99, ssn, fname, lname})}"
      Set myCmd1 = New ADODB.Command
      With myCmd1
          Set .ActiveConnection = myCnn
          .CommandText = mySQL
          .CommandType = adCmdText
      End With
      mySQL = "{call packperson.oneperson(?,{RESULTSET 2, ssn, fname, " _
             & "lname})}"
      Set myCmd2 = New ADODB.Command
      With myCmd2
          Set .ActiveConnection = myCnn
          .CommandText = mySQL
          .CommandType = adCmdText
          .Parameters.Append .CreateParameter(, adInteger, adParamInput)
      End With
      Set myRS = New ADODB.Recordset
      With myRS
          .CursorType = adOpenStatic
          .LockType = adLockReadOnly
      End With
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
      myCnn.Close
      Set myCnn = Nothing
      Set myCmd1 = Nothing
      Set myCmd2 = Nothing
      Set myRS = Nothing
    End Sub
    Package:
    PACKAGE packperson AS
    TYPE tssn is TABLE of NUMBER(10)
    INDEX BY BINARY_INTEGER;
    TYPE tfname is TABLE of VARCHAR2(15)
    INDEX BY BINARY_INTEGER;
    TYPE tlname is TABLE of VARCHAR2(20)
    INDEX BY BINARY_INTEGER;
    PROCEDURE allperson
    (ssn OUT tssn,
    fname OUT tfname,
    lname OUT tlname);
    PROCEDURE oneperson
    (onessn IN NUMBER,
    ssn OUT tssn,
    fname OUT tfname,
    lname OUT tlname);
    END packperson;
    BODY:
    PACKAGE BODY packperson
    AS
    PROCEDURE allperson
    (ssn OUT tssn,
    fname OUT tfname,
    lname OUT tlname)
    IS
    CURSOR person_cur IS
    SELECT ssn, fname, lname
    FROM employee;
    percount NUMBER DEFAULT 1;
    BEGIN
    FOR singleperson IN person_cur
    LOOP
    ssn(percount) := singleperson.ssn;
    fname(percount) := singleperson.fname;
    lname(percount) := singleperson.lname;
    percount := percount + 1;
    END LOOP;
    END;
    PROCEDURE oneperson
    (onessn IN NUMBER,
    ssn OUT tssn,
    fname OUT tfname,
    lname OUT tlname)
    IS
    CURSOR person_cur IS
    SELECT ssn, fname, lname
    FROM employee
    WHERE ssn = onessn;
    percount NUMBER DEFAULT 1;
    BEGIN
    FOR singleperson IN person_cur
    LOOP
    ssn(percount) := singleperson.ssn;
    fname(percount) := singleperson.fname;
    lname(percount) := singleperson.lname;
    percount := percount + 1;
    END LOOP;
    END;
    END;DB table:
    CREATE TABLE EMPLOYEE
    (FNAME VARCHAR2(15) NOT NULL,
    MINIT    CHAR,
    LNAME VARCHAR2(15) NOT NULL,
    SSN VARCHAR2(9) NOT NULL,
    BDATE DATE,
    ADDRESS VARCHAR2(30),
    SEX CHAR,
    SALARY NUMBER(10,2),
    SUPERSSN VARCHAR2(9),
    DNO NUMBER NOT NULL,
    PRIMARY KEY(SSN));
    DESC EMPLOYEE;
    INSERT INTO EMPLOYEE VALUES
    ('John','B', 'Smith', '123456789','09-JAN-65',
      '731 fONDREN, hOUSTON, TX', 'M', 30000, '333445555',5);
    INSERT INTO EMPLOYEE VALUES
    ('Frankin','T', 'Wong', '333445555','08-DEC-55',
      '683 Voss, Houston,Tx', 'M', 40000, '888665555',5);
    INSERT INTO EMPLOYEE VALUES
    ('Alicia','J', 'Zelaya', '999887777','19-JUL-68',
      '3321Castle, Spring, TX', 'F',25000 , '987654321',4);
    INSERT INTO EMPLOYEE VALUES
    ('Jennifer','S', 'Wallace', '987654321','20-JUN-41',
      '291 Berry, Bellaire, TX', 'F',43000 , '888665555',4);
    INSERT INTO EMPLOYEE VALUES
    ('Ramesh','K', 'Narayan', '666884444','15-SEP-62',
      '975 Fire Oak, Humble, TX', 'F',38000 , '333445555',5);
    INSERT INTO EMPLOYEE VALUES
    ('Joyce','A', 'English', '453453453','31-JUL-72',
      '5631 Rice,Houston,TX', 'F',25000 , '333445555',5);
    INSERT INTO EMPLOYEE VALUES
    ('Ahmad','V', 'Jabbar', '987987987','29-MAR-69',
      '980 Dallas,Houston, TX', 'M',25000 , '987654321',4);
    INSERT INTO EMPLOYEE VALUES
    ('James','E', 'Borg', '888665555','10-NOV-37',
      '450 Stone, Houston, TX', 'M',55000 , null,1);All help I will appreciat it.

    I can't comment on the problem returning PL/SQL arrays, but I will suggest that a more appropriate method of achieving your goal is to call a procedure which returns a REF CURSOR.
    See the examples here:
    http://asktom.oracle.com/~tkyte/ResultSets/index.html

  • Ejb QL 3.0 group by / return type issues

    Hello all. I have a question regarding ejb query language 3.0. I have a query that works and looks like the following:
    select e.objectId, count(distinct s1.objectId), count(distinct s2.objectId)
    from Engagement e JOIN e.surveys s1 JOIN e.surveys s2
    where s2.scope is not null
    and s2.schedule is not null
    and s2.quality is not null
    and s2.expertise is not null
    and s2.overallExperience is not null
    group by e.objectId
    While this query "works" I am unhappy with the result. What is returned by this query is an Object array of size 3. The first element is the objectId, the second the count of "sent surveys" and the third the count of "completed surveys". While this is correct for the query i want to execute a query selecting out an actual engagement object, not just the objectId. To accomplish this now, I would have to manually select out every column in engagement growing my Object array to n + 2 where n is the number of columns in Engagement. I find this unreasonable and not object oriented and would like to get an object array back that contains an Engagement object as the first element, and then the counts. However I am unaware of how to write this in ejb QL. If anyone has more experience than me please let me know if this is possible. The following code is incorrect but represents what I want to do:
    select e, count(distinct s1.objectId), count(distinct s2.objectId)
    from Engagement e JOIN e.surveys s1 JOIN e.surveys s2
    where s2.scope is not null
    and s2.schedule is not null
    and s2.quality is not null
    and s2.expertise is not null
    and s2.overallExperience is not null
    group by e /* alternatively 'group by e.objectId' or something of the like */
    For anyone else having trouble with ejb QL the best resource I have found is the BNF grammar on suns site. If you are trying to do anything complex, chances are there isn't an example out for you :(
    http://java.sun.com/javaee/5/docs/tutorial/doc/bnbuf.html#bnbui

    I realized what I wanted to the QL to do wasn't really fair. I was thinking if you wanted to do something like the above it could automatically group by first whatever the pk is on the entity and then who cares what order is next, just pick something so the SQL group by is satisfied. After more thought I realized this wasn't really a fair assumption the query engine could make and went about coding the specific items I wanted back in the select and made a corresponding entity object that acutely defined my result and used a constructor expression to create a list of these new objects. Hopefully someone else finds this useful and I appreciate the above response as well. Marking as answered.

Maybe you are looking for

  • Problem in sending System measurement report to sap (sdccn)

    Dear Gurus,                  I am facing a problem in sending the system measurement report to sap (USMM). I have have generated the system measurement report log and while sending it to sap . when i click on SEND TO SAP tab it gives me message "Data

  • HT1222 Have a lot of people in Cambodia use iPhone , but why iPhone don't add font Khmer in ios?

    Dear apple Please helpe to answer my question 1- I want ti know why apple dont add font khmer in ios ,because Have a lot of people in Cambodia use iPhone , 2- in my iPhone 5 restore errer 9 , I change USB and change computer already but can not fix i

  • About  "FIXUP_VTABLE"  in CS4

    In Cs4 sdk,there is a  VTableSupport.hpp : // If your plugin has a C++ object attached to it's globals, and if // the class of that object has virtual functions, those functions // will not work after the plugin is unloaded and then reloaded. // The

  • Cant use constant selection for ONE restriction in selection

    Hi, all BW70 SP8, BI Addon SP8 Rev 802. I cant use constant selection for ONE restriction in selection, i can set constant selection only for whole selection, but it fix value for all query. I need to fix only one character value. Is there a way of d

  • Need help on FSCM issue

    Hi All, Need your help on FSCM issue. We had an customer invoice posted through an interface . The invoice base line date is 12/16/2008 (due 30 days), interest is calculated for this invoice on 02/01/2009. The actual invoice amount is Rs 238.69 and t