Returning Resultset from different DB

Hi folks,
I am working on a developing a Database Framework. The user gives information about the stored proc to execute,parameters required by the stored prc, the connection url ,credentials and database provider(which can be Oracle,SQL Server or DB2). I have to execute the query and return back the resultset to the user.
What I am interested in knowing is does each and every DB provider handles or create the ResultSet in different way?
For Example:
In oracle the Stored proc call looks like setting a registerOutParameter and then getting the ResultSet:
String query = "{call ? := myStoredProc(?)}";
CallableStatement stmt = conn.prepareCall(query);
// register the type of the out param - an Oracle specific type
stmt.registerOutParameter(1, OracleTypes.CURSOR);
// set the in param
stmt.setFloat(2, price);
// execute and retrieve the result set
stmt.execute();
ResultSet rs = (ResultSet)stmt.getObject(1);And in SQL Server I can directly get the ResultSet by doing
ResultSet rs = stmt.executeQuery();Also the query string will be different i.e.
String query = "{call myStoredProc(?)}"DB2 will be same as Oracle I guess.
So my question is , is there any generic way to get the ResultSet???
Sorry if it sounds a dumb question.I am new to this arena..
Thanks in advance
Pankaj

DB2 will be same as Oracle I guess.No. Getting the resultset in DB2 looks the same as that for SQL Server. Oracle is the only one that has a slightly different code.

Similar Messages

  • Return Resultset from Procedure

    Hi --
    This may seem like a very elementary question, but can anyone tell me how to return a resultset from a function or procedure?
    Thanks,
    Christine

    if i understand your question correctly. a function return value is mandatory. while procedure is optional you had to use the out at the parameters. examples:
    CREATE OR REPLACE FUNCTION get_age (pBday Date) RETURN number IS
      vAge          Number := 0;
    BEGIN
      vAge := (Months_Between(sysdate,pBday) / 12);
      Return (vAge);
    END;
    CREATE OR REPLACE PROCEDURE get_age_procedure (pBday In Date, pAge Out Number) IS
    BEGIN
      pAge := (Months_Between(sysdate,pBday) / 12);
    END;
    /you need to create a reference cursor type object to achieve a result sets.
    CREATE OR REPLACE package TYPES AS
        TYPE cursorType IS REF CURSOR;
    END;

  • Returning ResultSet from servlet to jsp - java.lang.NullPointerException

    Hey all, i've been stuck on this for too long now...just trying to return a ResultSet from a servlet to jsp page.
    Had a bunch of problems earlier...which i think were fixed but...now i get a "java.lang.NullPointerException" in my jsp page when i try to get elements from the ResultSet object.
    Here is the latest version of my code:
    Servlet:
    String QueryStr="select ProdName from products";
    Statement stmt=conn.createStatement();
    rs=stmt.executeQuery(QueryStr); //get resultset
    sbean.setInventory(rs); //set ResultSet in bean
    req.getSession(true).setAttribute("s_resbean",sbean); //create session/request variable, set to bean
    Bean:
    package beans;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    import javax.sql.*;
    public class SearchBean extends HttpServlet{
         private int searchFlag=0;
         private ResultSet inventory;
         public SearchBean(){
         public int getSearchFlag(){
         return searchFlag;
         public ResultSet getInventory(){
              return inventory;
         public void setInventory(ResultSet rs){
              this.inventory=rs;
         public void setSearchFlag(){
              this.searchFlag=1;
    jsp:
    <%@ page language="java" import="java.lang.*,java.sql.*,javax.sql.*,PopLists.PopInvLists,beans.SearchBean"%>
    <jsp:useBean scope="session" id="s_resbean" class="beans.SearchBean" />
    <% ResultSet categories=PopInvLists.getCat();
    ResultSet manuf=PopInvLists.getManuf();
    ResultSet supplier=PopInvLists.getSupplier();
    ResultSet cars=PopInvLists.getCars();
    ResultSet search=(ResultSet)request.getAttribute("s_resbean");
    %>
    <%     while(search.next()){
         String pname=search.getString("ProdName");
    %>
    It craps out when i try to loop through the "search" ResultSet.
    I can loop through the rest of the ResultSets no problem....just this one doesn't work because it's set in a servlet, not a simple java class.
    Just to clarify, i am populating some dropdown lists on entry to the screen, which the user will use to perform a search. Once the search btn is clicked, the servlet is called, gets the request info for the search, performs search, and returns the resultset to the original screen. I want to eventually display the result under the search criteria.
    Someone....Please Please please tell me how to get this working...it should be very simple, but i just can't get it to work.
    Thanks in advance,
    Aditya

    req.getSession(true).setAttribute("s_resbean",sbean); //create session/request variable, set to beanHere you add an attribute to the session.
    ResultSet search=(ResultSet)request.getAttribute("s_resbean");Here you try to get the attribute from the request. Naturally it isn't there because you added it to the session, not the request. Despite your comment in the first line of code, a session is not a request. And vice versa.

  • Returning resultset from procedure...or pkg

    I am a newbie to Oracle but am steeped in MSSQL. I am accustomed to using a procedure to execute and produce a result set as its output from various input parameters thus keeping query complexity and details as a part of the database tier.
    Is there a best practice in Oracle that provides this capability? Is the 'ref cursor' the correct container to hold the recordset data (usually combined from various base tables...counts and sums for reports etc) and how should it be returned to a calling application (web page) to be iterated through? Perhaps as an output parameter?
    Thank you for helping with such a basic problem.

    Yes you would use a ref cursor, though it does not hold the results anywhere, they are fetched as needed, which is why it scales well.
    Re: OPEN cursor for large query
    Re: cursor ,inner join
    You can return a ref cursor from a function or procedure, it would be no different in a package.
    SQL> create or replace function f (p_deptno in number)
      2  return sys_refcursor as
      3    c sys_refcursor;
      4  begin
      5    open c for
      6      select empno, ename, job, sal from emp
      7        where deptno = p_deptno;
      8    return c;
      9  end;
    10  /
    Function created.
    SQL> var c refcursor
    SQL> exec :c := f(10)
    PL/SQL procedure successfully completed.
    SQL> print c
    EMPNO ENAME      JOB          SAL
      7782 CLARK      MANAGER     2450
      7839 KING       PRESIDENT   5000
      7934 MILLER     CLERK       1300
    SQL> create or replace procedure p
      2    (p_deptno in number, p_c out sys_refcursor)
      3  as
      4  begin
      5    open p_c for
      6      select empno, ename, job, sal from emp
      7        where deptno = p_deptno;
      8  end;
      9  /
    Procedure created.
    SQL> exec p(30, :c)
    PL/SQL procedure successfully completed.
    SQL> print c
    EMPNO ENAME      JOB          SAL
      7499 ALLEN      SALESMAN    1600
      7521 WARD       SALESMAN    1250
      7654 MARTIN     SALESMAN    1250
      7698 BLAKE      MANAGER     2850
      7844 TURNER     SALESMAN    1500
      7900 JAMES      CLERK        950
    6 rows selected.
    SQL>There are examples how to reference them in other languages here, note this was pre-9i when the built in sys_refcursor type was provided.
    http://asktom.oracle.com/tkyte/ResultSets/index.html

  • Pass variables and return ResultSet from same preparedStatement

    I am passing "fp" and "week_no" to a preparedStament in a class and want to return the values to my jsp page. "fp" and "week_no" are used twice. Please see below. When I run it, I get no error messages but, it doesn't display any data.
    I have the following code in a class:
    public ResultSet getHistory(String fp, String week_no)
                        throws SQLException, Exception {
    ResultSet rs = null;
    if (con != null) {
    try {
         PreparedStatement getHist;
         getHist = con.prepareStatement(
         "SELECT sbu, TO_CHAR(((sum_dollar) + (adj_sum_dollar)),'$999,999,999.99') AS sum_dollar, TO_CHAR(actual_date,'MM/DD/YY') AS actual_date, " +
         "((sum_cases) + (adj_sum_cases)) AS sum_cases, " +
         "((new_order_cases) + (adj_new_order_cases)) AS new_order_cases, " +
         "((total_open_orders) + (adj_total_open_orders)) AS total_open_orders, " +
         "((back_orders) + (adj_back_orders)) AS back_orders, " +
         "TO_CHAR((sum_dollar/sum_cases), '999.99') AS yield " +
         "FROM SUMMARY " +
         "WHERE actual_date BETWEEN (SELECT begin_dt " +
                   "FROM fiscal_calendar " +
                             "WHERE fiscal_period = '?' " +
                             "AND week_number = '?' " +
                             "AND week_number <> '9' " +
                             "AND fiscal_yr = '2003') " +
                        "AND " +
                             "(SELECT end_dt " +
                        "FROM fiscal_calendar " +
                             "WHERE fiscal_period = '?' " +
                             "AND week_number = '?' " +
                             "AND week_number <> '9' " +
                             "AND fiscal_yr = '2003') " +
              "ORDER BY actual_date, sbu ");
         getHist.setString(1, fp);
         getHist.setString(2, week_no);
         getHist.setString(3, fp);
         getHist.setString(4, week_no);
         rs = getHist.executeQuery();
         } catch (SQLException sqle) {
    error = "SQLException: Update failed, possible duplicate entry.";
         throw new SQLException(error);
    } else {
    error = "Exception: Connection to the database was lost.";
         throw new Exception(error);
    return rs;
    This is in my jsp:
    <%
    String fp = request.getParameter("fp");
    String week_no = request.getParameter("week_no");
    historyInfo.connect();
    ResultSet rs = historyInfo.getHistory(fp, week_no);
    while (rs.next()) {
    //String sum_dollar = rs.getString("sum_dollar");
    %>
    <%= rs.getString("sum_dollar") %>
    <%
    %>

    Hi,
    First thing U can't do this way in java. If U are executing this sort of database query, after retriving all the values, put inside Haahtable or HashMap as the application required and return it.
    Otherwise execute this query at the same place where u r printing values in jsp page insted of writing it inside seperate method..It will work.
    If still it's not workimg, please let me know.
    Rajeh Pal

  • How to return ResultSet from one function to another?

    Hi friends,
    Greetings.
    How do we pass the query Results from one function to another function?
    Actually i have a database in the server and i am the client.
    Client sends the id to the server as an argument. From HTML file this goes to the JSP file(which i am using as a link between HTML and EJB) and then this goes to the RemoteInterface and then to the Bean itself. The functions are written in the bean. Bean connects to the database using jdbc:odbc driver and then a query is written and executed as follows:
    In the Stateless Session Bean, there is one function with the following query.
    public ResultSet check(String id)
    //other code
    ResultSet rs = Statement.("select * from table1 where id=123");
    if(!rs.next)
    // print no such id exists. other ids are
    rs=Statement.("select * from table1");
    return rs;
    I have written it approximately only because the problem is not with the query :(
    Now, in rs there's a resultset. Now how do i display it in a tabular format in HTML? This should obviously be done using JSP. How can we do it?
    In JSP file if i write
    ResultSet rs1=Remote.check(12);
    i get NullPointerException
    Thank you in anticipation to your reply!
    Regards

    Crossposted over all places:
    [http://forums.sun.com/thread.jspa?threadID=5336533]
    [http://forums.sun.com/thread.jspa?threadID=5336534]
    [http://forums.sun.com/thread.jspa?threadID=5336532]
    [http://forums.sun.com/thread.jspa?threadID=5336519]
    [http://forums.sun.com/thread.jspa?threadID=5336510]
    Stop crossposting. It's very rude.

  • Returning resultSet from java function

    Hello,
    I have created one function which throws query to database and creates a resultset based on that query.
    I am trying to print the status of database i.e.,
    System.out.println(rs.next());This gives me result : true.
    I am then returning this resultSet to main function and doing the same thing :
    System.out.println(rs.next());but this time it gives me result : false.
    There are total 12 rows in this resultSet and i am not giving rs.next in any loops
    I would like to answer your further query,
    but i am eager to know the reason behind this.
    Thank you

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jonathan Roberts ([email protected]):
    Hi.
    Does anyone know what the syntax is for using java stored procedures or functions for returning a rowset.
    This includes the java in the java-sql and the java-procedure definition.
    Cheers
    Jonathan<HR></BLOCKQUOTE>
    null

  • Help! Need oracle help with constructing stored procedure that return resultsets

    Suns tutorial path for returning resultsets from stored procedures indicates that the following should work...
    CallableStatement cs = con.prepareCall("{call SHOW_SUPPLIERS}");
    ResultSet rs = cs.executeQuery();
    Thats if you build your stored procedure something like this ...
    String createProcedure = "create procedure SHOW_SUPPLIERS " + "as " + "select SUPPLIERS.SUP_NAME, COFFEES.COF_NAME " + "from SUPPLIERS, COFFEES " + "where SUPPLIERS.SUP_ID = COFFEES.SUP_ID " + "order by SUP_NAME";
    We are using oracle 8.1.6. However I've been told that with oracle procedures when you return a result set from a called procedure you return a p_cursor variable. Somthing like this
    (p_cursor in out SHOW_SUPPLIERS.SHOCurTyp)
    is
    begin
    open p_cursor for
    select * from suppliers
    In which case the above mentioned sun code doesn't work.
    We want to use jdbc to call a stored procedure that returns a resultset that does not require us to import any proprietary oracle objects...
    Is there another way to write these stored procedures, rather than using this cursor construct? Are we missing something in the way we invoke them?

    Suns tutorial path for returning resultsets from stored procedures indicates that the following should work...
    CallableStatement cs = con.prepareCall("{call SHOW_SUPPLIERS}");
    ResultSet rs = cs.executeQuery();
    Thats if you build your stored procedure something like this ...
    String createProcedure = "create procedure SHOW_SUPPLIERS " + "as " + "select SUPPLIERS.SUP_NAME, COFFEES.COF_NAME " + "from SUPPLIERS, COFFEES " + "where SUPPLIERS.SUP_ID = COFFEES.SUP_ID " + "order by SUP_NAME";
    We are using oracle 8.1.6. However I've been told that with oracle procedures when you return a result set from a called procedure you return a p_cursor variable. Somthing like this
    (p_cursor in out SHOW_SUPPLIERS.SHOCurTyp)
    is
    begin
    open p_cursor for
    select * from suppliers
    In which case the above mentioned sun code doesn't work.
    We want to use jdbc to call a stored procedure that returns a resultset that does not require us to import any proprietary oracle objects...
    Is there another way to write these stored procedures, rather than using this cursor construct? Are we missing something in the way we invoke them?

  • RFC call to a different system returns data from local system,

    Hi:
    I defined a RFC function and execute against a different system, the data returned is from the local system. The rfc_destination in SM59 works fine. The function works fine in the target system. No errors appear, just the data is not from the remote system.
    Any input will be appreciated.
    Thanks.
    Kamaraj

    Hi,
    For now, it seems u haven't specified the destination properly. the call function statement must be suffixed with the 'destination' addition to make sure that the function call is an RFC and the particular function be executed at the desired destination.

  • Registry.lookup() return Remote object from different ip address

    I've got this error using
    Registry reg = LocateRegistry.getRegistry(serverName, Registry.REGISTRY_PORT);
    service = (ILogin) reg.lookup("service");and when I use debugger I've got this
    RegistryImpl_Stub[UnicastRef [liveRef: [endpoint:[10.240.161.66:1099](remote),objID:[0:0:0, 0]]]]
    Proxy[ILogin,RemoteObjectInvocationHandler[UnicastRef [liveRef: [endpoint:[10.240.161.54:2074](remote),objID:[-4308ea07:116adade605:-7fff, 9133145996543447416]]]]]Why the Registry return a service from different IP address ?
    I've run this code for several times and it works. But today it cannot connect to the RMIServer.
    Any idea ?

    Thanks, i found my missing prppertis is
    // optional. Defaults to localhost. Only needed if web server is running
    // on a different host than the appserver
    props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
    // optional. Defaults to 3700. Only needed if target orb port is not 3700.
    props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
    to set the port and host back

  • Returning rowcount and resultset from stored procedure

    Hello,
    In SQL Server you can return multiple resultsets from stored procedure by simple SELECT statement. But in Oracle, you have to use SYS_REFCURSOR.
    Sample code:
    CREATE OR REPLACE PROCEDURE sp_resultset_test IS
    t_recordset OUT SYS_REFCURSOR
    BEGIN
    OPEN t_recordset FOR
    SELECT * FROM EMPLOYEE;
    END sp_resultset_test;
    Is there any other way in Oracle 10 or 11 ?
    Thank You.

    What is the requirement? Oracle is far more flexible than SQL-Server... with numerous features that do not exist in SQL-Server. (Fact)
    One of the biggest mistakes you can make is to treat Oracle like SQL-Server... trying to match feature A1 in SQL-Server to feature B3 in Oracle.
    Does not work that way.. rather then stick to SQL-Server as SQL-Server does SQL-Server specific features far better than Oracle.
    So instead of trying to map what a T-SQL stored proc to do to an Oracle ref cursor (even to the extent of using that very silly sp_ prefix to name the proc), tell us the problem and requirements... That way we can tell you what Oracle features and options are best used to solve that problem - instead of competing in some unknown feature comparison event with SQL-Server.

  • Are return codes from APIs different when upgrading DOT from 8.0.3 to 8.1.4/8.2.3 (7-mode only)

    Customer is looking to upgrade from DOT 8.0.3 to 8.1.4/8.2.3 (7-mode). There are no real API changes between these upgrades other than additional functionality being added. Howver, are the return codes from APIs any different when upgrading DOT from 8.0.3 to 8.1.4/8.2.3 (7-mode only)? Any help on this to help confirm would be greatly appreciated. Many Thanks in advance. Luke

    Thanks. I had the Portal 3.0.6/3.0.7/3.0.8 to Portal 3.0.9 upgrade scripts and instructions, but thought that was my last step. I hesitated on running the Portal Configuration Assistant. None of the instructions told me what to do at this point.
    Anyways, it looks that by running the Portal Configuration Assitant at the end of the 1.0.2.2 9iAS install, it created a new repository for Portal 3.0.9 in my database. Since I gave it a different schema name, I now have two portal repositories. The old Portal 3.0.6 repository (jvac_portal30) and the new Portal 3.0.9 repository (j_portal30).
    So, I assume I have to perform the upgrade scripts on the Portal 3.0.6 repository to get it to 3.0.9. Since we really did not have very much in the repository, we may just manually recreate everything in the new 3.0.9 repository. I have ssen several discussion threads about the upgrade and problems, so I am very leary to do it.
    In regards to our J Server propblem, we left for lunch. Came back and rebooted several more times, double checked all our configuration files (made no changes), stopped and restarted Apache several more times, and then by some miracle everything started working.
    null

  • How to return course  data  from different tables from a procedure

    I have a procedure which must return information from two tables:
    The sturcture of tables is as below:
    Table 1:
    id,
    name,
    property,
    type
    Table 2:
    id1
    id2 ,
    property.
    id1 of table2 refers to id attribute of table1. ie id is the foreign key for table2.
    the tables are defined such that for corresponding to each id in table1 there would
    be two or more rows in table2.
    Now in the procedure given the id, i need to retrieve information from table1 and also all the rows in table2 which refers to id2.I want to return a cursor.How can i do this.
    eg:
    if table 1 has an entry with id 2
    and table 2 has three entries with id1 referring to id(i.e id1=2)..I need to return the table1 entry with id=2 and three entires from table2 with id1=2.
    If cursors are not appropriate, what other alternative methods can be used.
    Any suggestions would be of great help.

    thanks for the reply,
    The result set would be returned to the client .....which would do further processing.The client does not even know that the data is organized in two tables..Therefore given an id, client would expect to have all the information...i.e the info from table 1 and info from table 2 where the relation ship between id and other ids are stored.
    i.e say client has id=6.This id has property,name,etc stored in table1.
    This id can further be related to any number other of ids.It can be related 2,5,100,or may be even 10000s of other ids.This mapping between the original id and other ids..are stored in table2.
    So given the id by the client , i would want to return property of the ids itself along with all the ids that it is related to .
    I want to achieve this.....

  • How to get only column names from different tables as single table columns

    Hi All,
       I have one requirement in which we want only column names from different tables.
    for example :
     I have three tables T1 ,T2, T3 having
      col1 clo2 clo3 -->  T1 , 
      col3 col5 ,clo6 --> T2 ,
      Clo6 col8 col9 --> T3
    columns i want to get only all  Column names from all table as single Resultset not any data from that how can i get that empty resultset 
    because this empty result i want to bind in datagridview(front end) as Empty resultset 
    Please tell me anyways to do this
    Niraj Sevalkar

    If I understand you want an empty result set, just with metadata. SET FMTONLY do the trick:
    SET FMTONLY ON
    SELECT Col1, Col2, Col3, ....., Coln
    FROM
    T1 CROSS JOIN T2 CROSS JOIN T3
    SET FMTONLY OFF
    Another alternative is to include an imposible contition
    SELECT Col1, Col2, Col3, ....., Coln
    FROM
    T1 CROSS JOIN T2 CROSS JOIN T3
    WHERE 1 = 0
    If you are using a SqlDataAdapter in your client application. You can use the FillSchema method. the select command may be any select statement that returns the columns you want. Under the covers FillSchema will call SET FMTONLY ON.
    If you are using SqlCommand.ExecuteReader you can pass SchemaOnly to CommandBehavior argument. SET FMTONLY ON is called under the covers. Again the select command may be any select statement that returns the columns you want.
    "No darás tropezón ni desatino que no te haga adelantar camino" Bernardo Balbuena

  • Returning rows from stored proc

    Hello, this is the sample from the SQL Developer help to create proc:
    CREATE OR REPLACE
    PROCEDURE list_a_rating(in_rating IN NUMBER) AS
    matching_title VARCHAR2(50);
    TYPE my_cursor IS REF CURSOR;
    the_cursor my_cursor;
    BEGIN
    OPEN the_cursor
    FOR 'SELECT title
    FROM books
    WHERE rating = :in_rating'
    USING in_rating;
    DBMS_OUTPUT.PUT_LINE('All books with a rating of ' || in_rating || ':');
    LOOP
    FETCH the_cursor INTO matching_title;
    EXIT WHEN the_cursor%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(matching_title);
    END LOOP;
    CLOSE the_cursor;
    END list_a_rating;
    You have to write a cursor just to display results from a query. To me this is whacked but I'll go with it. So what if you wanted to return that resultset or refcursor so it can be consumed by a calling application or procedure? I tried something like
    CREATE OR REPLACE PROCEDURE list_a_rating(in_rating IN NUMBER, MatchingTitles OUT Ref Cursor)
    but that's not compiling. How do you return data from a proc or function?
    Thanks,
    Ken

    ktrock wrote:
    Hello, this is the sample from the SQL Developer help to create proc:A very poor example..
    You have to write a cursor just to display results from a query. To me this is whacked but I'll go with it. All SQL you send to Oracle for parsing and execution winds up as SQL cursors in the server's SQL shared pool. You, the client, then get a handle as reference to this cursor that was created for your SQL statement. Using this handle you can now fetch the output of the cursor and consume it on the client side.
    So there is no such thing as not using a cursor - you always use cursors. Many times it will be implicitly as you won't see the cursor workings as the client hides that from you.
    As for DBMS_OUTPUT and PL/SQL... PL/SQL cannot "write output". And time and again (stupid?) people will use DBMS_OUTPUT thinking that is "writing to the client's display device".
    It is not. It is writing data into a PL/SQL variable on the server. PL/SQL variable that consumes very expensive dedicated process memory on the server. The client (SQL-Developer, TOAD, SQL*Plus, etc) can read the contents of this variable and the client can render that contents on the client's display device.
    So how on earth does it make sense to take SQL data on the server (that is structured data and can vary significantly in volume), and write that as plain text into a PL/SQL variable?
    It does not make sense. At all. Bluntly put - it is just plain bloody stupid.
    So how do you return data using PL/SQL? The same way as you return data using SQL.
    PL/SQL allows the complexity of the SQL language, database model and so on to be moved from the client application into PL/SQL itself. The client thus no longer need to know table names, what to join where and when, how to write effective SQL and so on. It calls a PL/SQL procedure with optional parameters. This procedure has the logic to create the required SQL (based on the parameters too if applicable) and return the cursor handle for that SQL.
    The client thus calls PL/SQL, PL/SQL serves as the SQL abstraction layer and does the complex SQL bit, and PL/SQL then returns the SQL cursor handle to the client.
    In the PL/SQL language, there are different data types for dealing with the same SQL cursor handle - depending on what you want to do with that SQL cursor.
    If you want to pass that SQL cursor handle to a client, then you need to use the sys_refcursor data type in PL/SQL. Remember that SQL cursor does not know or care what data type the client (such as PL/SQL) uses to reference it. All SQL cursors in the server's shared pool are the same - how you treat them from a client side (as an explicit cursor, implicit cursor, ref cursor, etc) is a client program decision.
    Also keep in mind that a SQL cursor is NOT a result set. It is not a data set that is instantiated or created on the server that contains the data (or references to the data) for your SQL.
    If this was the case - just how many such cursor result sets could the server create before running out of memory?
    A cursor is an executable program. The source SQL code is compiled into a program called a cursor. This cursor contains the execution steps that the server needs to follow to find the data. The cursor then outputs this data as data is found. The execution plan of a cursor shows how this program looks like.

Maybe you are looking for

  • Computer and iTunes freezes when iPod is plugged in

    Hi there. I'm using Windows Vista x32 SP1 and lately I've had a problem with my iPod and iTunes. It hasn't always been like this as recently I have been updating my iPod, but for some reason something has caused a problem. I can use iTunes fine and p

  • ID & password is NOT working with the Menu Bar CC icon

    ID & password that I use for the Adobe CC web page login is NOT working with the Menu Bar CC icon (Mac OS 10.10.2). I have two updates to download, but the ID and/or password is rejected. Also the the "Hint" field is blank.https://forums.adobe.com/di

  • SAP EasyDMS

    Hello Everyone, I have one requirement for mass upload/Download documents in DMS. I read certain discussions which held earlier & decided to go for Sap Easy DMS. Is this right decision ? I have integrated this with ECC & it is working fine as of now.

  • How to get system idle time

    Hello Sir, I am Udhaya. I don't know how to capture system idle time using java. Please any one help me how to get system idle time. Any class is available in java to get idle time? Thank in advance Udhaya

  • IMac gets hung up on SoftwareUpdateLauncher when doing the Maverick 10.9.2 update this morning.

    After software update from the AppStore it hangs up during the reboot process in SoftwareUpdateLauncher.  Must do a hard shutdown to recover.  It reboots under old OS version but is still looking for the the reboot to complete the update which always