Returning multiple records

Hi I want to run a query on a table and display the results which will be multiple records in my table in a browser. E.g:
String sql="SELECT * FROM Table1";
Statement stmt = con.createStatement();
rs = stmt.executeQuery(sql);

I am a little lost can you steer me in the right direction once more please.
while (rs.next())
          v1.add(rs.getString("NAME"));
          v2.add(rs.getString("ADDRESS"));
          v3.add(rs.getString("SEX"));
%>
     <table>
     <tr>
          <td width="22" bgcolor="#993399">
          <font color="#000000" size="2" face="Arial"><b>Name</b></font></td>
          <td bgcolor="#993399" align="center" width="87"><font color="#000000" size="2"><b>ADDRESS</b></font></td>
          <td bgcolor="#993399" align="center" width="87"><font color="#000000" size="2"><b>SEX</b></font></td>
     </tr>
<%
     for (int i=0;i<v1.size();i++)
%>
     <tr><td><%=v1.get(i)%></td>
     <td><%=v2.get(i)%></td>
     <td><%=v3.get(i)%></td>
     </tr>
<%     }
%>

Similar Messages

  • SQL Command returns multiple records, but I see only one record in report

    I work with Crystal Reports XI R2 SP3 and Oracle 10g R2 database.
    I have an SQL Command that returns multiple records. Command name is "CommDivisionNames" and it returns column "CommDivisionNames.DIVISION_NAME". When I place this field into report details section of the report, I can see all 10 records returned and this is how it should be. I actually need this field to be placed in the report header section, and when I place the field there, then I see only the first record. I set that field as "can grow = true". When I do "browse field data" for this field, I see that all 10 records are there, but only the first one is displayed in report header section.
    I thought that I can place SQL Command field anywhere on the report (page header, footer, details) and that it will always show all records that it returns from the database. Can that be done?
    My "main part" of the report returns different set of records, and that's what I have in "report details" section. I need this list of divisions to be in the report header section, so user can see that the report was executed for DivA, DivC, DivE.
    Thank you,
    Milan

    sharonamt:
    Users select divisions from parameter, but the parameter multi values are division_numbers (1,5,10), not division_names. Division_names are visible in parameter_prompt_window as description, but parameter remembers only numbers and I don't know how I can reuse division_names later in formula.
    I do join for division_numbers and make them into one string variable and pass to sub-report, but I think that I can only get these division_names by calling an SQL command or calling stored procedure.
    If I try to do join({MySQLcommand.DIVISION_NAME}) I get error message "A string array is required here".
    Carl:
    I'm playing with cross-tab and I can use it to see all division_names in the report-header section. Since I need them in only one column or only one row, I have to edit cross-tab object and turn all unneeded border lines to white to make them look invisible. So, cross-tab could be a solution for my problem here.
    Another option could be to re-write my SQL command. Since I've read here that SQL command could be written in the same way as I would write a stored procedure, then I could use a bit more complex code to get all multiple division names from the database table into a local cursor, and then use do-while loop to concatenate them into one string, and then to return that string as one record (like 'DivA, DivB, DivC'), and then it should not be a problem to display only that one record/string in report header. It is my understanding that Crystal Reports can call stored procedure that works with many cursors/recordsets and CR will use only the last recordset from the stored procedure. Do you think it could be done this way?
    Thank you,
    Milan

  • Stored procedure returning multiple records without using SYS_REFCURSOR

    Hello,
    I am new to oracle stored procedures, have done stored procs in SQL server in past. I am trying to write single stored proc which will return multiple records. I have the stored proc as below and that is compiled without any errors.
    We don't want to use SYS_REFCURSOR as output param b'coz the place from which this proc is gonna call, that system doesn't support SYS_REFCURSOR param.
    create or replace
    PROCEDURE p_get5500DATA_MB (
    IN_plan_ID IN T_5500DATA_QWP.Plan_ID%TYPE,
    IN_plan_ID_col OUT T_5500DATA_QWP.Plan_ID%TYPE,
    p_SEQNUM OUT T_5500DATA_QWP.SEQNUM%TYPE,
    p_HEADER_CD OUT T_5500DATA_QWP.HEADER_CD%TYPE,
    p_VALUE1 OUT T_5500DATA_QWP.VALUE1%TYPE,
    p_VALUE2 OUT T_5500DATA_QWP.VALUE2%TYPE
    ) AS
    BEGIN
    SELECT
    Plan_ID,
    SEQNUM,
    HEADER_CD,
    VALUE1,
    VALUE2
    INTO
    IN_plan_ID_col,
    p_SEQNUM,
    p_HEADER_CD,
    p_VALUE1,
    p_VALUE2
    FROM TRS1DBO.T_5500DATA_QWP
    WHERE Plan_ID = IN_plan_ID
    ORDER BY SeqNum;
    -- EXCEPTION
    -- WHEN OTHERS THEN
    -- RAISE_APPLICATION_ERROR(-210001, 'Error in fetching data from T_5500DATA_QWP....');
    END;
    Error:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "TRS1DBO.P_GET5500DATA_MB", line 10
    ORA-06512: at line 11
    My questions is:
    - What would be the best practice for this type of simple stored procedures?
    - Is there any alternate or is there anything i can fix in above stored proc which return multiple records?
    Thank you,
    Vimal

    Just out of curiosity, what are you using for API or driver that doesn't support a ref cursor? Ref cursors are pretty much the defacto standard for passing multiple records out of an Oracle procedure. Oracle's ODP.NET, OLEDB, ODBC, JDBC, OCI, all support ref cursors. Chances are that if the driver you're using doesn't support something as basic/fundamental as a ref cursor, it's probably also not going to support something else either.
    You'll most likely want to check with the driver/api vendor on their recommended approach.

  • Returning Multiple Record sets to VB.

    Is it possible using an Oracle 7 Driver connecting to a Oracle 9i database to return multiple record sets to screens written in VB? this is all a new area for me and the people I've spoken to so far seem to think it isn't possible - I refuse to believe this - someone must have done this before?!?!? Can someone confirm either way before I go down this path!!!!
    Cheers

    Sounds like you need a join statement in your SQL, is the
    category and field info in different tables, then a join would be
    perfect, also what language are you using. I know another way in
    php you could use a while loop with another RS inside that gets the
    proper field info for each category.
    check out this:
    http://www.w3schools.com/sql/sql_join.asp

  • Query is returning multiple records for a bank account id and party id

    Hi All,
    I am not getting why this query is returning multiple records for a particular bank account id and party id:
    SELECT instrument_payment_use_id
    ,instrument_type
    ,instrument_id
    ,start_date
    ,ext_pmt_party_id
    FROM iby_pmt_instr_uses_all
    WHERE instrument_id =:lv_num_ext_bank_account_id
    and exists (select 1 from iby_external_payees_all b where PAYEE_PARTY_ID= :lv_num_party_id and b.ext_payee_id = ext_pmt_party_id)
    I want above values to be used in api iby_disbursement_setup_pub.set_payee_instr_assignment in R12.
    Please help asap.
    Thanks

    O/P of query run for
    SELECT rowid, instrument_payment_use_id
    FROM iby_pmt_instr_uses_all
    WHERE instrument_id =6642
    AND EXISTS (
    SELECT 1
    FROM iby_external_payees_all b
    WHERE payee_party_id= 85470
    AND b.ext_payee_id = ext_pmt_party_id);
    is below:
    Rowid     INSTRUMENT_PAYMENT_USE_ID
    AABiDXAGIAABhiKAAS     236586
    AABiDXAGRAABSjtAAz     148437
    The version is R12

  • PLSQL web service returning multiple records

    Hello,
    I am trying to create a web service using oracle 11g which should be able to return multiple records.
    Based on hints and code samples found on the internet here is my code :
    CREATE OR REPLACE TYPE test_rec is OBJECT (
        s_nume_adre                    NUMBER ,
        c_eta_civi                     VARCHAR2(4 BYTE),
        l_nom1_comp                    VARCHAR2(40 BYTE),
        l_nom2_comp                    VARCHAR2(40 BYTE),
        l_nom3_comp                    VARCHAR2(40 BYTE),
        l_pren_comp                    VARCHAR2(30 BYTE),
        d_date_nais                    DATE);
    CREATE OR REPLACE TYPE test_array AS TABLE OF test_rec;
    CREATE OR REPLACE PACKAGE test_pkg AS
      function get_rows(snume_adre in number) return test_array;
    END;
    CREATE OR REPLACE PACKAGE BODY test_pkg AS
      function get_rows(snume_adre in number) return test_array is
        v_rtn   test_array := test_array(null);
        v_first boolean := true;
        cursor c_get_rows(snume_adre in number) is
          SELECT a.s_nume_adre,
                 nvl(a.c_eta_civi, '') c_eta_civi,
                 nvl(a.l_nom1_comp, '') l_nom1_comp,
                 nvl(a.l_nom2_comp, '') l_nom2_comp,
                 nvl(a.l_nom3_comp, '') l_nom3_comp,
                 nvl(a.l_pren_comp, '') l_pren_comp,
                 nvl(a.d_date_nais, to_date('01.01.1900', 'dd.mm.yyyy')) d_date_nais
        FROM bro.z45 a
      where a.s_nume_adre = snume_adre or snume_adre is null;
      begin
        for rec in c_get_rows(snume_adre) loop
          if v_first then
            v_first := false;
          else
            v_rtn.extend;
          end if;
        v_rtn(v_rtn.last) := test_rec(rec.s_nume_adre, rec.c_eta_civi, rec.l_nom1_comp, rec.l_nom2_comp,
                                    rec.l_nom3_comp, rec.l_pren_comp, rec.d_date_nais);
        end loop;  
        return v_rtn;
      end;
    END;
    --select * from table (test_pkg.get_rows(null));
    I am able to retrieve the data using the select.
    However when I try to access its wsdl I get an error :
    <soap:Envelope>
       <soap:Body>
          <soap:Fault>
             <faultcode>soap:Client</faultcode>
             <faultstring>Error processing input</faultstring>
             <detail>
                <OracleErrors></OracleErrors>
             </detail>
          </soap:Fault>
       </soap:Body>
    </soap:Envelope>
    If I comment the function call in the package declaration I get a "correct" wsdl :
    <definitions name="GET_ROWS" targetNamespace="http://xmlns.oracle.com/orawsv/TEST/TEST_PKG/GET_ROWS" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns.oracle.com/orawsv/TEST/TEST_PKG/GET_ROWS" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
      <types>
        <xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/TEST/TEST_PKG/GET_ROWS" elementFormDefault="qualified">
          <xsd:element name="GET_ROWSInput">
            <xsd:complexType>
              </xsd:complexType>
          </xsd:element>
          <xsd:element name="GET_ROWSOutput">
            <xsd:complexType>
              </xsd:complexType>
          </xsd:element>
       </xsd:schema>
      </types>
      <message name="GET_ROWSInputMessage">
        <part name="parameters" element="tns:GET_ROWSInput"/>
      </message>
      <message name="GET_ROWSOutputMessage">
        <part name="parameters" element="tns:GET_ROWSOutput"/>
      </message>
      <portType name="GET_ROWSPortType">
      <operation name="GET_ROWS">
          <input message="tns:GET_ROWSInputMessage"/>
          <output message="tns:GET_ROWSOutputMessage"/>
        </operation>
      </portType>
      <binding name="GET_ROWSBinding" type="tns:GET_ROWSPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="GET_ROWS">
          <soap:operation soapAction="GET_ROWS"/>
          <input>
            <soap:body parts="parameters" use="literal"/>
          </input>
          <output>
            <soap:body parts="parameters" use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="GET_ROWSService">
        <documentation>Oracle Web Service</documentation>
        <port name="GET_ROWSPort" binding="tns:GET_ROWSBinding">
           <soap:address location="http://server.domain.ch:8080/orawsv/TEST/TEST_PKG/GET_ROWS"/>
         </port>
      </service>
    </definitions>
    Any hint as how to create and access pl sql web service returning multiple rows?
    I don't use java and don't have access to tools like JDeveloper.
    Thanks!

    The actual issue is that collection types are not supported for return parameters.
    The solution is to wrap the collection into another object.
    Here's a working example based on your settings :
    CREATE OR REPLACE TYPE test_rec is OBJECT ( 
      empno  number(4)
    , ename  varchar2(10)
    , hiredate date
    CREATE OR REPLACE TYPE test_array AS TABLE OF test_rec; 
    CREATE OR REPLACE TYPE test_array_wrapper is OBJECT ( arr test_array );
    CREATE OR REPLACE PACKAGE test_pkg AS 
      function get_rows(p_deptno in number) return test_array_wrapper; 
    END; 
    CREATE OR REPLACE PACKAGE BODY test_pkg AS 
      function get_rows(p_deptno in number) return test_array_wrapper is 
        results  test_array; 
      begin 
        select test_rec(empno, ename, hiredate)
        bulk collect into results
        from scott.emp
        where deptno = p_deptno;    
        return test_array_wrapper(results); 
      end; 
    END; 
    The wsdl is then generated correctly :
    SQL> select httpuritype('http://DEV:dev@localhost:8080/orawsv/DEV/TEST_PKG/GET_ROWS?wsdl').getxml() from dual;
    HTTPURITYPE('HTTP://DEV:DEV@LOCALHOST:8080/ORAWSV/DEV/TEST_PKG/GET_ROWS?WSDL').GETXML()
    <definitions name="GET_ROWS" targetNamespace="http://xmlns.oracle.com/orawsv/DEV/TEST_PKG/GET_ROWS" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns.oracle.com/orawsv/DEV/TEST_PKG/GET_
    ROWS" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
      <types>
        <xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/DEV/TEST_PKG/GET_ROWS" elementFormDefault="qualified">
          <xsd:element name="CTEST_ARRAY_WRAPPER-GET_ROWSInput">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="P_DEPTNO-NUMBER-IN" type="xsd:double"/>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="GET_ROWSOutput">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="RETURN" type="tns:TEST_ARRAY_WRAPPERType"/>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
          <xsd:complexType name="TEST_ARRAY_WRAPPERType">
            <xsd:sequence>
              <xsd:element name="TEST_ARRAY_WRAPPER">
                <xsd:complexType>
                  <xsd:sequence>
                    <xsd:element name="ARR">
                      <xsd:complexType>
                        <xsd:sequence>
                          <xsd:element name="TEST_REC" type="tns:TEST_REC_IntType" maxOccurs="unbounded" minOccurs="0"/>
                        </xsd:sequence>
                      </xsd:complexType>
                    </xsd:element>
                  </xsd:sequence>
                </xsd:complexType>
              </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
          <xsd:complexType name="TEST_REC_IntType">
            <xsd:sequence>
              <xsd:element name="EMPNO" type="xsd:double"/>
              <xsd:element name="ENAME">
                <xsd:simpleType>
                  <xsd:restriction base="xsd:string">
                    <xsd:maxLength value="10"/>
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>
              <xsd:element name="HIREDATE" type="xsd:date"/>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:schema>
      </types>
      <message name="GET_ROWSInputMessage">
        <part name="parameters" element="tns:CTEST_ARRAY_WRAPPER-GET_ROWSInput"/>
      </message>
      <message name="GET_ROWSOutputMessage">
        <part name="parameters" element="tns:GET_ROWSOutput"/>
      </message>
      <portType name="GET_ROWSPortType">
        <operation name="GET_ROWS">
          <input message="tns:GET_ROWSInputMessage"/>
          <output message="tns:GET_ROWSOutputMessage"/>
        </operation>
      </portType>
      <binding name="GET_ROWSBinding" type="tns:GET_ROWSPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="GET_ROWS">
          <soap:operation soapAction="GET_ROWS"/>
          <input>
            <soap:body parts="parameters" use="literal"/>
          </input>
          <output>
            <soap:body parts="parameters" use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="GET_ROWSService">
        <documentation>Oracle Web Service</documentation>
        <port name="GET_ROWSPort" binding="tns:GET_ROWSBinding">
          <soap:address location="http://localhost:8080/orawsv/DEV/TEST_PKG/GET_ROWS"/>
        </port>
      </service>
    </definitions>

  • How to return multiple record with Oracle Native Web Service?

    Dear all,
    I would like to know that the oracle native web service can be able to return multiple records to client or not?
    I successfully developed the oracle native web service for returning single record but the next challenge is to develop web service in order to return multiple record (like Employees data base on each department)
    Thank and Regards,
    Zenoni

    I successfully developed the oracle native web service for returning single record but the next challenge is to develop web service in order to return multiple record (like Employees data base on each department)You could return a list (multiple values/records) in XML format (using XMLType or CLOB), or CSV, or JSON, or whatever.
    function get_employees (p_department_id in number) return clob
    as
    begin
      return 'your_xml_string_here';
    end get_employees;It would be up to the client (the caller of the web service) to extract the values from whatever format you decide upon, of course.
    - Morten
    http://ora-00001.blogspot.com

  • Returning multiple records from the DB

    Hi all,
    Can anybody tell me how to return multiple result set using stored procudure. For example "select * from users" works in SQL Plus, but we can't use it in a stored procedure. Any alternative to extract multiple result set from the DB.

    Tom Kyte explains this en detail here:
    Result Sets from Stored Procedures In Oracle
    http://asktom.oracle.com/~tkyte/ResultSets/index.html

  • Procedure to insert in table from other table returning multiple records

    Hi Everybody,
    I am new to oracle. So need your advice guys. I have to insert values to one table from another table. Please let me know , how i can do this.
    E.g:
    INSERT INTO TABLEA(`Name`,`ID`,`another_field`) VALUES ('Somevalue',(SELECT DISTINCT id FROM TABLEB WHERE tb.cat = '5' AND ID NOT IN (select id from TABLEC)), 'somevalue')
    Above thing is not working for me.
    I have to insert ID IN TABLE A by getting value from this query:
    SELECT DISTINCT id FROM TABLEB WHERE tb.cat = '5' AND ID NOT IN (select id from TABLEC)
    This query is returning multiple IDs, so how can i insert all in TABLEA by creating some sp.
    Please help me out of this. I will be very thankful to you all guys. I will really appreciate your suggestions and comments.
    Regards
    Dev

    Why cant you just do this,
    INSERT INTO TABLEA (NAME, ID, another_field)
       SELECT DISTINCT 'Somevalue',
                       ID,
                       'somevalue'
         FROM TABLEB
        WHERE tb.cat = '5'
          AND ID NOT IN (SELECT ID FROM TABLEC)G.

  • Is there a way to use owa_opt_lock.checksum in Select query that returns multiple records?

    Trying to do something as data would be uploaded and edited in grid. At present I am using Ora_Hash.
    SELECT
            e.ROWID, e.Employee_Id,e.First_Name,e.Last_Name,e.Email,e.Phone_Number,e.Hire_Date,
            e.Job_Id,e.Salary,e.Manager_Id,e.Department_Id,
            owa_opt_lock.checksum('HR','EMPLOYEES', e.rowid) As HashForThisRow
    FROM EMPLOYEES e;
    Thx

    No you can't.
    owa_opt_lock.checksum is a function which is used for optimist locking. It locks the row(probably by using Select FOR Update mechanism) which you select and which you are trying to update. As a result, what you are eventually trying to do is that inside a Select query you are using a function that is locking the rows, which is not allowed. And thus your query will fail with the below mentioned error.
    ORA-14551: cannot perform a DML operation inside a query
    ORA-06512: at "SYS.DBMS_SQL", line 1575
    ORA-06512: at "SYS.OWA_OPT_LOCK", line 172
    14551. 00000 -  "cannot perform a DML operation inside a query "
    *Cause:    DML operation like insert, update, delete or select-for-update
               cannot be performed inside a query or under a PDML slave.
    *Action:   Ensure that the offending DML operation is not performed or
               use an autonomous transaction to perform the DML operation within
               the query or PDML slave.
    Thanks,
    Ishan

  • Send multiple records in Email

    I use BPEL 11g to send an email notification, I retrieve the data from a table which returns multiple records to the db adapter.
    I have to send all the records in the Email body. How do I do this ?
    The following is the payload I see, But I dont see any content in the email that I receive.
    Thanks for your help !
    <ReplyToAddress/>
    <Subject>Selected Rows !</Subject>
    <Content>
    <MimeType>text/html; charset=UTF-8</MimeType>
    <ContentBody>
    <TestTab1>
    <col1>2</col1>
    <col2>REI</col2>
    <col3>SantaClara</col3>
    </TestTab1>
    <TestTab1>
    <col1>1</col1>
    <col2>REI</col2>
    <col3>SanJose</col3>
    </TestTab1>
    </ContentBody>
    <ContentEncoding/>
    </Content>
    <Cc/>
    <Bcc/>
    <NotificationContext/>

    I appreciate your quick response . Here is what I am doing in the transform .
    <xsl:template match="/">
    <client:processResponse>
    <xsl:variable name="Temp">""</xsl:variable>
    <xsl:for-each select="/ns0:TestTab1Collection/ns0:TestTab1">
    <xsl:variable name="Temp" select="concat(ns0:col3,$Temp)"/>
    <client:result>
    <xsl:value-of select="$Temp"/>
    </client:result>
    </xsl:for-each>
    </client:processResponse>
    </xsl:template>
    </xsl:stylesheet>
    The output payload is as follows : ( SantaClara is returned as 1st record and SanJose is returned as second record from the db adapter)
    <outputVariable>
    <part name="payload">
    <processResponse>
    <client:result>SantaClara""</client:result>
    <client:result>SanJose""</client:result>
    </processResponse>
    </part>
    </outputVariable>
    But I want
    <outputVariable>
    <part name="payload">
    <processResponse>
    <client:result>SantaClara SanJose</client:result>
    </processResponse>
    </part>
    </outputVariable>
    And I am trying to send SantaClara SanJose in the email body.
    Thanks for your help.

  • Calling multiple records from SP

    Hi,
    I tried to use a CallabaleStatement to call an SP that would return multiple records but wasn't successful.
    The Problem is the 'cstmt.executeQuery()' statement returns NULL. How to solve this?
    I have tested the SP and it works fine. Pls help! And thanks. (Btw, I am using JDBC:ODBC driver and accessing Oracle database.)
    Below are the methods that I used to set the IN parameters and the methods I used to register OUT parameters:-
    ResultSet rs = null;
    //call to the SP.
    CallableStatement cstmt = con.prepareCall("{ call artmovby_date (?,?,?,?,?,?) }");
    //based on the SP, the following set methods are used.
    cstmt.setInt (1, pLanguage);
    cstmt.setString (2, pCustomerCode);
    cstmt.setString (3, pStartDate);
    cstmt.setString (4, pEndDate);
    //based on the SP, the following are the JDBC
    // types registered for OUT parameters
    cstmt.registerOutParameter(5, java.sql.Types.NUMERIC, 0);
    cstmt.registerOutParameter(6, java.sql.Types.OTHER);
    //using executeQuery since the SP
    //contains 'select' statement only.
    try { rs = cstmt.executeQuery(); } catch (Exception e) { e.printStackTrace(); }
    Below is the information of the package and SP created in the database:-
    CREATE OR REPLACE PACKAGE FetchData is
    -- The purpose of the package is just define the recordset.
    Define Record Types
    TYPE ArtMoveOneRecTyp is RECORD
    ( Article SDGPOS.ARTNR%TYPE,
    Shipment_No SDGPOS.SDGNR%TYPE,
    Customer_Ref SDGPOS.KUNDENREF%TYPE,
    Shipment_Date SDG.BELDATUM%TYPE,
    In_Or_Out SDGPOS.FUNKTION%TYPE,
    Quantity1 SDGPOSMG.MENGE%TYPE,
    Quantity2 SDGPOSMG.MENGE%TYPE,
    LineNr SDGPOS.NR%TYPE,
    UnitLoad1 SDGPOSMG.RANG%TYPE,
    UnitLoad2 SDGPOSMG.RANG%TYPE);
    -- Define PL/SQL Table --
    TYPE ArtMoveRecTyp IS TABLE OF ArtMoveOneRecTyp
    INDEX BY BINARY_INTEGER;
    END FetchData;
    create or replace procedure artmovby_date
    language IN number,
    customerid IN varchar2,
    startdate IN varchar2,
    enddate IN varchar2,
    p_size out number,
    p_array out FetchData.ArtMoveRecTyp
    ) is
    cursor get_art_mov_by_date
    (p_language number,
    p_customerid varchar,
    p_startdate varchar,
    p_enddate varchar) is
    SELECT P.ARTNR, P.SDGNR, P.KUNDENREF, SDG.BELDATUM, P.FUNKTION,
    M1.MENGE, M2.MENGE, P.NR, M1.RANG, M2.RANG
    FROM
    SDG,
    SDGPOS P,
    SDGPOSSTATUS S,
    STATI_TEXTE ST,
    ARTIKEL A,
    LHM,
    LHMTEXTE L,
    MONITURENST MO, MONITURENTEXTE MOT,
    SDGPOSMG M1, ARTMENGENEINH AE1, EINHEITENTEXTE E1,
    SDGPOSMG M2, ARTMENGENEINH AE2, EINHEITENTEXTE E2
    WHERE
    P.KUNDENNR = S.KUNDENNR(+)
    AND P.FUNKTION = S.FUNKTION(+)
    AND P.SDGNR = S.SDGNR(+)
    AND P.NR = S.SDGPOSNR(+)
    AND 'J' = S.AKTIV(+)
    AND 'SDGPOS' = ST.TYP(+)
    AND p_language = ST.SPRACHE(+)
    AND S.STATUS = ST.STATUS(+)
    AND S.FUNKTION = ST.FUNKTION(+)
    AND P.KUNDENNR = A.KUNDENNR(+)
    AND P.ARTNR = A.NR(+)
    AND P.LHMNR = LHM.NR(+)
    AND P.LHM = L.NR(+)
    AND p_language = L.SPRACHE(+)
    AND P.MONITUR = MO.NR(+)
    AND MO.NR = MOT.NR(+)
    AND p_language = MOT.SPRACHE(+)
    AND P.KUNDENNR = M1.KUNDENNR(+)
    AND P.FUNKTION = M1.FUNKTION(+)
    AND P.SDGNR = M1.SDGNR(+)
    AND P.NR = M1.SDGPOSNR(+)
    AND 1 = M1.RANG(+)
    AND P.KUNDENNR = AE1.KUNDENNR(+)
    AND P.ARTNR = AE1.ARTNR(+)
    AND 1 = AE1.RANG(+)
    AND AE1.MGEHNR = E1.NR(+)
    AND p_language = E1.SPRACHE(+)
    AND P.KUNDENNR = M2.KUNDENNR(+)
    AND P.FUNKTION = M2.FUNKTION(+)
    AND P.SDGNR = M2.SDGNR(+)
    AND P.NR = M2.SDGPOSNR(+)
    AND 2 = M2.RANG(+)
    AND P.KUNDENNR = AE2.KUNDENNR(+)
    AND P.ARTNR = AE2.ARTNR(+)
    AND 2 = AE2.RANG(+)
    AND AE2.MGEHNR = E2.NR(+)
    AND p_language = E2.SPRACHE(+)
    AND SDG.NR = P.SDGNR(+)
    AND SDG.KUNDENNR = P.KUNDENNR(+)
    AND SDG.FUNKTION = P.FUNKTION
    AND ( P.KUNDENNR = p_customerid )
    AND ( SDG.BELDATUM BETWEEN TO_DATE( p_startdate ,'DD/MM/YYYY' )
    AND TO_DATE( p_enddate , 'DD/MM/YYYY' ))
    AND S.STATUS >= 35
    ORDER BY P.ARTNR ASC, SDG.BELDATUM ASC;
    begin
    p_size :=0;
    open get_art_mov_by_date (language, customerid, startdate, enddate);
    loop
    fetch get_art_mov_by_date into p_array(p_size);
    exit when get_art_mov_by_date%NOTFOUND;
    p_size := p_size +1;
    end loop;
    close get_art_mov_by_date;
    end;
    /

    like for other structure we set occurence as 0 to unbound if we wanna send multiple messages ...
    If you want to send multiple records u r occurence must be 0 to unbound in RFC also..
    check that for your RFC ?
    Regards
    Rao
    Edited by: PT Rao on Jun 12, 2008 5:13 PM
    Edited by: PT Rao on Jun 12, 2008 5:17 PM

  • Mapping Multiple records from Db Adapter to the project data objects

    If the database adapter do a query to the database and return multiple records, how can I map those records to the data object? And If I want to iterate the records and each record to invoke a sub-process, what can I do?

    On the XSL file, I did the following
    <xsl:template match="/">
    <ns1:SetOfAccount>
    <xsl:for-each select="/ns0:RplanAccountCollection/ns0:RplanAccount">
    <ns1:accounts>
    <ns2:accountId>
    <xsl:value-of select="ns0:pkAcctId"/>
    </ns2:accountId>
    <ns2:accountName>
    <xsl:value-of select="ns0:ownerName"/>
    </ns2:accountName>
    </ns1:accounts>
    </xsl:for-each>
    </ns1:SetOfAccount>
    </xsl:template>
    </xsl:stylesheet>
    for each record which read back from the database adapter is rplanAccountCollection, rplanAccount, I tried to put the value onto the accounts arrays which has a type of account with account id and account name. But I dun think it is correct, please advice

  • TcDataSet for Multiple Records

    Hi,
    I am trying to write one custom adapter to fetch some values from OIM database using sql query
    That sql query returns multiple records.
    I am using tcdataset APIs to get values. However I am able to write the code when it returns 1 value
    What is the method of tcDataSet can be used when it returns multiple rows.
    Pls suggest.It would be great if you could send some used code snippet.
    Thanks!!

    JRS wrote:
    Hi,
    I am trying to write one custom adapter to fetch some values from OIM database using sql query
    That sql query returns multiple records.
    I am using tcdataset APIs to get values. However I am able to write the code when it returns 1 value
    What is the method of tcDataSet can be used when it returns multiple rows.
    Pls suggest.It would be great if you could send some used code snippet.
    Thanks!!
    tcDataSet dataSet = new tcDataSet();
    dataSet.setQuery(this.oDataProvider, strCheckQuery);
    dataSet.executeQuery();
    for(int i=0;dataSet.getRowCount() i++){
         dataset.gotoRow(i);
    }

  • Multiple records from PL/SQL

    Hi,
    Can anybody give me an example of returning multiple records selected from PL/SQL procedure to a Java program .
    It will be very good if i can get PL/SQL procedure code and Java program code.
    Thanx.

    Use the SampleCode link at the top of the page. Look under JDBC samples for REF CURSOR.

Maybe you are looking for

  • Can I use instrument driver in a software applicatio​n

    Hi, I'd like to develop a generic driver to control any instrument from a software application . Can I use the LabWindows/CVI wizard to succeed ? Once I have created my dll, does it mean something to call IVI function from a sofware application ? (fo

  • My iphone 3gs is factory reset now for three hours and the charger still!

    I do not know what to do for it to work. Have tästat try to stop but you can not have tried to take out the sim card but it does not work either! For help with this now!

  • Kernel_task high CPU usage yosemite

    Hi, I have a problem with my old macbook pro 15" Early 2011 The battery was dead so I bought a new one and replaced it. I also installed a new Samsung SSD. Then after the startup (OSX Mavericks was installed) I had a high CPU usage on the kernel_task

  • Missing DW CS4 on Windows7

    In downloading DW CS4 on my new computer Windows7, there are no spaces for infilling information in the Property Inspector at the right side for Title and Target. Is there any way to fix this?

  • Preserving Meta Data when encoding JPEG (JAI)

    I have a project where the requirements are that images which I compress (using the JPEG encoder of JAI) must be as much compressed as possible, but also must not be altered in any other way from the original image file, i.e. things like meta data mu