ResultSet wihtin ResultSet but causes cursor problem?

I have a SQL error when running the code below:
while(rs0.next()){ ...
String s= rs0.getString(1);
ResultSet rs=null;
rs=getResult1(aConnnection, s);
/*statment is created in the function and ResultSet returned */
while(rs.next()){ ...
rs.close();
rs0.close();
Error: java.sql.SQLException: ORA-01000: maximum open cursors exceeded
The database setting is 200 cursors
and rs0 has 300 records, rs has only one record each time. I thought there should be only 2 cursors involved, do not know how can get so many.
Could some one help with my question?
Thanks in advance,
YM

Rethink your design.
If you let a method create a statement and a resultset, but return only the resultset, then there's no possibility to close the statetement.
I would create the statement outside the method, pass it to the method to do the query and return the resultset, but control the statement in my calling code.
So in your example you would hold references to 2 stattement just the same way like to their resultsets and close them all together.
This is more clean, and maybe will solve your cursor problem.
If you should come to the result that you would really need more open cursors (if your app runs on many clients at the same time, it could), there must be a DBMS configuration for increasing this limit.

Similar Messages

  • ResultSet wihtin ResultSet but cause cursor problem?

    I have a SQL error when running the code below:
    while(rs0.next()){                              ...                          
    String s= rs0.getString(1);
    ResultSet rs=null;
    rs=getResult1(aConnnection, s);
    /*statment is created in the function and ResultSet returned      */
    while(rs.next()){                               ...
    rs.close();
    rs0.close();
    Error: java.sql.SQLException: ORA-01000: maximum open cursors exceeded
    The database setting is 200 cursors
    and rs0 has 300 records, rs has only one record each time. I thought there should be only 2 cursors involved, do not know how can get so many.
    Could some one help with my question?
    Thanks in advance,
    YM

    Maybe you're stocking up on open Statement objects in your function - try closing them?
    Cheers

  • My macbook pro decided to give a different res and a horizontal line follows my cursor (like a diagnostic mode or something) i have shutdown/restrted. Fixed the res but the cursor problem still exists any help please.

    I was using my mac as normal and then my resultion on mr screen changed which i have fixed using the normal methods but i still continue on getting a horizontal line whereever my cursor is even after i have restarted and shut down. The line is a white colour but my other screens seem dulled wherever this line is not following it is not a solid white. It looks like its in a diagnostic mode or somthing. Any help would be appriciated, thanks.

    It is possible there is a problem with the computer's graphics, but try a simple fix. viz. reset the NVRAM / PRAM.
    Resetting NVRAM / PRAM
    Shut down your Mac.
    Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.

  • Repost - DIV causing cursor problem

    Hi All,
    I have a <Div> over this form that appears to be
    causing difficulty with placing the cursor in the field. It is
    doable but you must very deftly place your pointer at the very top
    edge of the field you wish to enter:
    This is just a quick test page to test a new product I'm
    developing. Page requires win Win/IE.
    http://www.norrisoft.com/testing/showoff/targetPage.html
    Any ideas?
    As an additional bit of help, can you tell me what you think
    of the context sensitive help? I have been developing a product
    that allows someone without html knowledge or flash knowledge to
    create Turbo-Tax-like help for web pages and context-sensitive help
    for html forms.
    Thanks!
    Steve

    You didn't respond to my reply to your previous post.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "norrisoft" <[email protected]> wrote in message
    news:e3g4pi$8jv$[email protected]..
    > Hi All,
    >
    > I have a <Div> over this form that appears to be
    causing difficulty with
    > placing the cursor in the field. It is doable but you
    must very deftly
    > place
    > your pointer at the very top edge of the field you wish
    to enter:
    >
    > This is just a quick test page to test a new product I'm
    developing. Page
    > requires win Win/IE.
    >
    >
    http://www.norrisoft.com/testing/showoff/targetPage.html
    >
    > Any ideas?
    >
    > As an additional bit of help, can you tell me what you
    think of the
    > context
    > sensitive help? I have been developing a product that
    allows someone
    > without
    > html knowledge or flash knowledge to create
    Turbo-Tax-like help for web
    > pages
    > and context-sensitive help for html forms.
    >
    > Thanks!
    >
    > Steve
    >
    >

  • Div causing cursor problem?

    Hi All,
    I have a <Div> over this form that appears to be
    causing difficulty with placing the cursor in the field. It is
    doable but you must very deftly place your pointer at the very top
    edge of the field you wish to enter:
    This is just a quick test page to test a new product I'm
    developing. Page requires win OS/IE.
    http://www.norrisoft.com/testing/showoff/targetPage.html
    Any ideas?
    As an additional bit of help, can you tell me what you think
    of the context sensitive help? I have been developing a product
    that allows someone without html knowledge or flash knowledge to
    create Turbo-Tax-like help for web pages and context-sensitive help
    for html forms.
    Thanks!
    Steve

    Why do you have a div over a field?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "norrisoft" <[email protected]> wrote in message
    news:e3eiak$4b3$[email protected]..
    > Hi All,
    >
    > I have a <Div> over this form that appears to be
    causing difficulty with
    > placing the cursor in the field. It is doable but you
    must very deftly
    > place
    > your pointer at the very top edge of the field you wish
    to enter:
    >
    > This is just a quick test page to test a new product I'm
    developing. Page
    > requires win OS/IE.
    >
    >
    http://www.norrisoft.com/testing/showoff/targetPage.html
    >
    > Any ideas?
    >
    > As an additional bit of help, can you tell me what you
    think of the
    > context
    > sensitive help? I have been developing a product that
    allows someone
    > without
    > html knowledge or flash knowledge to create
    Turbo-Tax-like help for web
    > pages
    > and context-sensitive help for html forms.
    >
    > Thanks!
    >
    > Steve
    >
    >
    >

  • When I open Firefox the following alert appears: "Could not initialize the application's security component. The most likely cause is problems with files in your application's profile directory." There is a solution in the forum but only for Windows based

    When I open the application the following alert appears: "Could not initialize the application's security component. The most likely cause is problems with files in your application's profile directory." There is a solution on the support site but only for Windows-based Firefox, and I'm a Mac user. I have plenty of room on my hard disk.
    == This happened ==
    Every time Firefox opened
    == Two days ago, for no apparent reason.

    In Mac OS X v10.7, the $HOME/Library folder is a hidden folder.
    Open Finder and use one of these:
    * Go > Go To Folder (Shift-Command-G) and in the dialog type: ~/Library
    * Open the "Go" menu and hold down the Option key to make the Library appear
    You can also use this command in a Terminal window to remove the hidden flag.
    * Mac HD > Applications > Utilities > Terminal
    * chflags nohidden ~/Library

  • Same old...number of rows in a resultset...but a different question

    Hi,
    I'm writing a code to generate report from the database. Everything is working absolutely fine. Now the problem is that when I try to check whether any row has been returned, I'm not able to do it correctly. What is happening is that the column heading is also being considered as a data and being written to the output file. I want that if there is no data ( excepting the column headings ) the program should terminate. Can anyone help me out of this? Thanks & regards,
    Faisal

    Hi,
    Plz find the code below :
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    public class JDBC8
         public static void main (String[] args) throws Exception
                        Connection con = null;
                        final String query = "select TNAME,TABTYPE from tab where tname like '%FAZ%'";
                        Statement stmt = null;
                        int ctr=0;
                        int maxColLength = 0;
                        String fileName = "";
                        ResultSet rs = null;
                        FileNameCreater obj = new FileNameCreater();
                        fileName = obj.getFileName();
                        int t = 0;
                        System.out.println("Created file : " +fileName);
                        try {
                             // load the driver
                                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                        catch (java.lang.ClassNotFoundException e)
                                  System.err.print("ClassNotFoundException.");
                                  System.err.println(e.getMessage());
                        System.out.println("Connecting to the database. Please wait....");
                        try {
                                       // define the connection URL. establish the connection.
                                       con = DriverManager.getConnection("jdbc:odbc:DSN1","mis","abcdef#0");
                                       if ( con.isClosed() )
                                       System.out.println("Failed to connect to the database. Press enter to continue.");
                                       System.in.read();
                                       else
                                       System.out.println("Connected to the database.");
                                       System.out.println("Processing...Please be patient...");
                                       // create a statement object
                                       stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
                                       // Execute a query
                                       rs = stmt.executeQuery(query);
                                       ResultSetMetaData rsmd = rs.getMetaData();
                                       rs.first();
                                       System.out.println("check 1 = " + rs.getRow());
                                       System.in.read();
                                       int cntr = 0;
                                       String tempStr = "";
                                       String tempLbl = "";
                                       boolean flag = false;
                                       boolean inWhile = false;
                                       rs.beforeFirst();
                                       while ( rs.next() )
                                            System.out.println("entered while");
                                            System.in.read();
                                            tempStr = rs.getString(++cntr);
                                            tempLbl = rsmd.getColumnLabel(cntr);
                                            System.out.println("cntr = " + cntr + " tempStr = " + tempStr + " tempLbl = " + tempLbl);
                                            if ( tempStr == tempLbl )
                                                 flag = true;
                                            else
                                                 flag = false;
                                            inWhile = true;
                                       if ( inWhile )
                                                 rs.beforeFirst();
                                                 FileWriter writer = new FileWriter(fileName);
                                                 BufferedWriter buf_Writer = new BufferedWriter(writer);
                                                 System.out.println("Processing started...");
                                                 int colCount = 0;
                                                 colCount = rsmd.getColumnCount();
                                                 String colLabel = "";
                                                 for ( int x = 1; x <= colCount; x++ )
                                                      colLabel = rsmd.getColumnLabel(x);
                                                      buf_Writer.write(colLabel);
                                                      if ( x < colCount )
                                                           buf_Writer.write("|");
                                                 buf_Writer.newLine();
                                                 rs.beforeFirst();
                                                 // Process the results
                                                 while(rs.next())
                                                 ctr++;
                                                      for (int i = 1; i <= colCount; i++)
                                                           String columnValue = rs.getString(i);
                                                           buf_Writer.write(columnValue);     
                                                           if ( i < colCount )
                                                                buf_Writer.write("|");               
                                                      buf_Writer.newLine();
                                                 buf_Writer.close();
                             catch (SQLException e)
                                  System.err.println("SQLException : " + e.getMessage());
                             finally
                                  try
                                       // Close the resultset, statement and connection objects.
                                            if (rs != null)
                                                 rs.close();
                                            if (stmt != null)
                                                 stmt.close();
                                            if (con!=null)
                                                 con.close();
                                       catch(Exception ex)
                                            System.out.println("Exception encountered: "+ ex.getMessage());
                                  System.out.println("Program completed successfully.");
    } // end of main
    } // end of class

  • My iphone 4 automatically shuts down , twice it has happened though it starts by holding the home screen and sleep button for 10 seconds but what exactly causes this problem? some defect in my set?

    My iphone 4 automatically shuts down , twice it has happened though it starts by holding the home screen and sleep button for 10 seconds but what exactly causes this problem? some defect in my set?

    do you hold the home and sleep button?

  • I don't know what I downloaded that caused the problem, but now when I try to make a new folder on the desktop of my new Windows 7 computer, I have only the fol

    I don't know what I downloaded that caused the problem, but now when I try to make a new folder on the desktop of my new Windows 7 computer, I have only the following choices: Shortcut, Bitmap Image, Contact, Microsoft Word Document, Journal Document, Microsoft Powerpoint Presentation, Text Document, Microsoft Excel Worksheet, and Briefcase. No new folder choice. Anyone have any ideas how I can correct the problem?

    This support forum is for Firefox related issues. The volunteers on this forum can only help with Firefox issues.
    Please consider contacting another support service like [http://www.ask.com/answers/browse?o=0&l=dir&qsrc=321 Ask.com].
    Sorry.

  • Computer fails to boot up after password change. After new password keyed in, computer also asked for old password. But even when old password supplied, computer just freezes and fails to boot up. What is causing the problem and how can one solve it?

    Changed password on MacBook Pro recently. But after password change. Computer ask for old password, thereafter. Even when correctly supplying the old password. Computer system does not boot up and just freezes. What is causing the problem and how can one resolve the issue?

    OS X 10.7 Lion, 10.8 Mountain Lion, 10.9 Mavericks and 10.10 Yosemite
    Reset Password
    Start the computer,then press and hold down command and R keys to start into recovery partition.
    When you see the Apple logo, release the keys.
    Wait until  OS X Utilities window shows up.
    Move the mouse pointer to the menubar at the top and click "Utilities", then select "Terminal"
    from the drop down.
    Terminal window will appear.
    Type in   resetpassword   and press enter on the keyboard.
    Leave the Terminal window open.
    Reset Password Utility window will open with Macintosh HD selected.
    Select the user account from the popup menu box under “Select user account”.
    Enter a new password.
    Reenter the new password for the user.
    Enter a hint.
    Click the "Save" button.
    Click  in the menubar and select Restart.
    Log in.
    If Keychain dialog box appears, select “Create New Keychain”.

  • My computer, running on Lion, randomly flashes with crazy lights and colors. Doesn't happen often, but when it does it's totally random. What causes this problem and how can I solve it?

    My MacBook Pro, running on Lion, randomly flashes with crazy lights and colors. Doesn't happen often, but when it does it's totally random. It looks like the Northern LIghts!!!
    What causes this problem and how can I solve it?

    Really? Oh I get it. You're the kind of person who goes on tech message boards to make jokes - or friends.
    Well, I'm trying to solve this problem - which is a rather annoying way to spend a Saturday.
    SO either help or don't reply.

  • Firefox 5.0 is supposed to have a separaret Twitter tab, but I noticed today that that tab is missing. What is causing this problem?

    Firefox version 5.0 has a separate Twitter tab built into this web browser. However, today I have been having problems with launching the Firefox browser. An error message appears, after attempting to launch the browser, which states that the Firefox browser is already running, and that the process needs to be closed or that the computer needs to be restarted. After restarting my computer and launching the Firefox browser, I noticed that the built-in Twitter tab ( near the upper left-hand corner of the browser ) was missing. What is causing these problems?

    I'm pretty sure that Firefox version 5.0 has a built-in Twitter tab. Whatever the case may be, I downloaded Firefox version 5.0.1 this morning. I learned that if you right-click on a tab, that a menu box will appear on the screen. One of the options in that menu box is "Pin as App Tab." If I go to the http://twitter.com web site, and then right-click on the corresponding Twitter tab, and then select "Pin as App Tab," then a small Twitter tab will appear to the right of the orange-and-white "Firefox" tab ( in the upper left-hand corner of the Firefox web browser screen ). Then I can click on that Twitter tab and go directly to the http://twitter.com web site. However, when I exit the Firefox version 5.0.1 web browser, and then immediately re-launch it, the separate Twitter tab is gone. Is there any way, within Firefox version 5.0.1, that I can make the separate Twitter tab permanent after selecting "Pin as App Tab"? Thank you for your assistance regarding this matter.
    ''Edited by a moderator due to inappropriate content.''

  • 10.5.2 fixed old problems, but caused many new ones!

    I had many of the problems reported using Leopard, including multiple daily OS crashes. After they released 10.5.2, I did an ERASE and INSTALL, reinstalled Leopard and performing all of the updates in a timely manner, repairing permissions after each update, etc. After re-installing all of my apps, including FCP Studio 2, I started to test everything. First thing I noticed was that upon opening iPhoto, iTunes, Final Cut Pro and Soundtrack Pro...there were no windows that opened! All of the apps opened, but displayed no windows that went along with the apps. I made sure that all of the windows were "active" in the menu bar, but none of them showed up on the screen. After a re-start, I got most of the apps windows to appear(iPhoto was still not working). Now keep in mind, I had never had anything like this happen in 10.5.1. I also began to notice a 1-pixel-thick horizontal line that appeared on the lower third of my screen, either just on the desktop picture, or sometimes just in the current open application window. Sometimes the line was a solid green, other times it was broken up and black. I also just experienced another "screen going black" OS crash...if that's what it was.
    I have been using Apple's products back when I was mocked for buying anything Apple, and I have never had problems like this until they became "mainstream". It seems the more popular Apple becomes, the worse the quality of their products becomes. At least in their "computer" branded products. Anyone else experiencing this?

    Sorry but I've not seen anything like this. I've upgraded my own personal entourage of computers to Leopard (we have 5 at home), at work (a lab of 25 plus at least 10 staff members), and helped or advised a slew of friends and customers.
    Have I seen problems? Yes but all of them have been attributable to known factors and fixable. The default Upgrade mode turns out to be a big no no with Leopard. Running old utilities that require updates or upgrades are another. Marginal RAM reared its ugly head again, though not as badly has it has in the past. I recall one issue that I tracked down to a very full hard drive - I recommend leaving at least 10% or 10GB free which ever is bigger.
    Your mention of the horizontal line could indicate a hardware problem. Running the hardware diagnostics disk would be a good idea. Unfortunately, the tool that Apple gives us is 100% reliable at indicating there is a problem but sometimes a problem does exist and the program fails to flag it. This is particularly true of RAM, so you should keep this in mind as you move forward.
    If you pass the diagnostics test, I'd say (ugh) format and reinstall only OS X. Unplug everything but the mouse and keyboard and keep it that way until near the end of your rebuild process. Go online, configure your email, and see if things are okay. If so, while online check out the status of updates of all your software. Download as needed. Now slowly install new software and test the computer a bit before going on to the next. Slowly add peripherals and their drivers. WIth luck, all will go well this time. If not, by taking it slow and testing at each step, you should be able to isolate the offending culprit.

  • Invalid cursor problem

    Steve,
    Were you ever able to look at this item? In the meantime, my work around was to do a separate xsql query for each sub-query(cursor) and then append nodes in my DOM as I went along. But, I would like to help this tool be better. I think I have determined that if one of the sub-select/sub-cursor queries doesn't return anything, I get the "invalid cursor" error. Does that make sense to you? I think that if a the result should still be a blank node
    ( </NODE> ). What do you think?
    thanks,
    chad.
    -----Original Message-----
    From: Chad Small
    Sent: Friday, September 22, 2000 9:31 AM
    To: 'Steve Muench'
    Subject: RE: LONG data type and subsequent CURSOR's question/problem
    I attached two files:
    1. file with sql script - you'll have to change the schema.
    2. file with code. Two sections
    a. 1st with jdbc result set code
    b. 2nd with OracleXMLQuery
    I comment out one or the other code section to run one or the other.
    If you need any other information, please let me know.
    thanks,
    chad.
    -----Original Message-----
    From: Steve Muench [mailto:[email protected]]
    Sent: Thursday, September 21, 2000 4:14 PM
    To: Chad Small
    Subject: Re: LONG data type and subsequent CURSOR's question/problem
    Is it possible to send me CREATE TABLE script with one row
    of sample data inserted that reproduces the problem?
    Thanks.
    Steve Muench, Lead XML Evangelist & Consulting Product Manager
    BC4J & XSQL Servlet Development Teams, Oracle Rep to XSL WG
    Author "Building Oracle XML Applications", O'Reilly http://www.oreilly.com/catalog/orxmlapp/
    ----- Original Message -----
    From: "Chad Small" <[email protected]>
    To: "'Steve Muench'" <[email protected]>
    Sent: Thursday, September 21, 2000 3:56 PM
    Subject: RE: LONG data type and subsequent CURSOR's question/problem
    |
    | Using the same query string on both programs:
    |
    | String xsqlString =
    | "SELECT hwp.publish_document_id, hwp.topic_id, hwp.section_id,
    | hwp.body, " +
    | "CURSOR( SELECT hws.name as section_name " +
    | "FROM health.section hws " +
    | "WHERE hwp.section_id = hws.section_id) as section " +
    | "FROM health.publish_document hwp " +
    | "WHERE hwp.publish_document_id IN (13729, 1033, 11695)";
    | ____________________________________________________________________________
    | ______
    | This works - simple JDBC program :
    |
    | PreparedStatement stmt = conn.prepareStatement(xsqlString);
    | ResultSet rs = stmt.executeQuery();
    |
    | int n=1;
    | while( rs.next() ) {
    | System.out.println(n+": publish_document_id =
    | "+rs.getInt("publish_document_id"));
    | System.out.println(n+": topic_id = "+rs.getInt("topic_id"));
    | System.out.println(n+": section_id = "+rs.getInt("section_id"));
    | n++;
    | }
    | rs.close();
    | stmt.close();
    | conn.close();
    | ____________________________________________________________________________
    | ______
    | This does not work - simple OracleXMLQuery:
    |
    | OracleXMLQuery qry = new OracleXMLQuery(conn, xsqlString);
    | System.out.println("after\n");
    | // structure the generated XML document
    | qry.setMaxRows(1); // set the maximum number of rows to be returned
    | qry.setStyleSheet("file:D:\\xsql\\bin\\healthwise.xsl"); // sets the
    | stylesheet
    |
    | // get the XML document in string format
    | String xmlString = qry.getXMLString();
    |
    | // print out the XML document
    | System.out.println(" OUTPUT IS:\n"+xmlString);
    | conn.close();
    | ____________________________________________________________________________
    | _______
    | -> get this:
    |
    | OUTPUT IS:
    | <?xml version = '1.0'?>
    | <ERROR>oracle.xml.sql.OracleXMLSQLException: Stream has already been
    | closed</ERROR>
    |
    |
    | java.sql.SQLException: ORA-01001: invalid cursor
    |
    | at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
    | at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
    | at oracle.jdbc.ttc7.Oclose.receive(Oclose.java:126)
    | at oracle.jdbc.ttc7.TTC7Pr otocol.close(TTC7Protocol.java:493)
    | at oracle.jdbc.driver.OracleStatement.close(OracleStatement.java:467)
    | at
    | oracle.jdbc.driver.OracleConnection.close_statements(OracleConnection.java:1
    | 141)
    | at oracle.jdbc.driver.OracleConnection.close(OracleConnection.java:537)
    | at com.healthecare.search.apelon.xmlquerydb.main(xmlquerydb.java:116)
    | at symantec.tools.debug.Agent.runMain(Native Method)
    | at symantec.tools.debug.MainThread.run(Agent.java:48)
    |
    |
    | Please advise.
    |
    | thanks,
    | chad.
    | -----Original Message-----
    | From: Steve Muench [mailto:[email protected]]
    | Sent: Thursday, September 21, 2000 1:46 PM
    | To: Chad Small
    | Subject: Re: LONG data type and subsequent CURSOR's question/problem
    |
    |
    | Are you able to test the query that does cause the
    | problem with:
    |
    | -> The command-line XSU utility
    | -> A simple JDBC program that creates a prepared statement
    | with this query and executes it to produce a result set
    |
    | I want to know if the problem is in JDBC or XSU.
    |
    | ______________________________________________________________
    | Steve Muench, Lead XML Evangelist & Consulting Product Manager
    | BC4J & XSQL Servlet Development Teams, Oracle Rep to XSL WG
    | Author "Building Oracle XML Applications", O'Reilly
    | http://www.oreilly.com/catalog/orxmlapp/
    |
    | ----- Original Message -----
    | From: "Chad Small" <[email protected]>
    | To: "'Steve Muench'" <[email protected]>
    | Sent: Thursday, September 21, 2000 1:09 PM
    | Subject: RE: LONG data type and subsequent CURSOR's question/problem
    |
    |
    | | The problem does NOT occur in (1) -simple query.
    | | And yes, the problem does occur in (2) - in combination with CURSOR.
    | |
    | | thanks,
    | | chad.
    | |
    | | -----Original Message-----
    | | From: Steve Muench [mailto:[email protected]]
    | | Sent: Thursday, September 21, 2000 11:44 AM
    | | To: Chad Small
    | | Subject: Re: LONG data type and subsequent CURSOR's question/problem
    | |
    | |
    | | Trying to isolate the problem a little...
    | |
    | | (1) Does the problem occur if you do a simple query like:
    | |
    | | SELECT body FROM table
    | |
    | | with just the LONG column?
    | |
    | | (2) Or does it only happen in combination with CURSOR() ?
    | |
    | | ______________________________________________________________
    | | Steve Muench, Lead XML Evangelist & Consulting Product Manager
    | | BC4J & XSQL Servlet Development Teams, Oracle Rep to XSL WG
    | | Author "Building Oracle XML Applications", O'Reilly
    | | http://www.oreilly.com/catalog/orxmlapp/
    | |
    | | ----- Original Message -----
    | | From: "Chad Small" <[email protected]>
    | | To: <[email protected]>
    | | Sent: Thursday, September 21, 2000 10:24 AM
    | | Subject: LONG data type and subsequent CURSOR's question/problem
    | |
    | |
    | | | Hello Steve,
    | | |
    | | | First I want to thank-you for all of the support you put into Oracle's
    | XML
    | | | board. I just ordered your book from Fatbrain and it's on back order!
    | I
    | | | tried asking my question on the board and didn't have any luck getting
    | any
    | | | responses - maybe people didn't understand my question. I'm desperate
    | for
    | | | this to work and really need some guidance.
    | | |
    | | | I'm using the command line to extract data from tables to XML
    | | | (.bin\xsql\bin\xsql healthwise.xsql chad.xml). Everything works
    | | wonderfully
    | | | until I add a LONG data type to the mix. Here is my xsql before the
    | LONG:
    | | |
    | | | <?xml version="1.0"?>
    | | | <!-- healthwise_xslt.xsql -->
    | | | <xsql:query
    | | | xmlns:xsql="urn:oracle-xsql"
    | | | connection="healthwise_dev2"
    | | | max-rows="22050" >
    | | |
    | | | SELECT hwp.publish_document_id, hwp.topic_id, hwp.section_id,
    | | | CURSOR( SELECT hws.name as section_name
    | | | FROM health.section hws
    | | | WHERE hwp.section_id = hws.section_id) as section,
    | | | CURSOR( SELECT hwk.name as keyword_name
    | | | FRO M health.keyword hwk, health.map_keyword_object
    | | | hwmko, health.object hwo
    | | | WHERE (hwp.publish_document_id =
    | | | hwo.publish_document_id) and
    | | | (hwo.object_id = hwmko.object_id) and
    | | | (hwmko.keyword_id = hwk.keyword_id) ) as keywords,
    | | | CURSOR( SELECT hwt.name as topic_name,
    | | | CURSOR( SELECT hwts.name as topic_synonym_name
    | | | FROM health.topic_synonym hwts
    | | | WHERE hwt.topic_id = hwts.topic_id) as
    | | | topic_synonyms,
    | | | CURSOR( SELECT hwc.name as catagory_name
    | | | FROM health.category hwc,
    | | health.map_category_topic
    | | | hwmct
    | | | WHERE (hwt.topic_id = hwmct.topic_id) and
    | | | (hwmct.category_id = hwc.category_id) ) as catagories
    | | | FROM health.topic hwt
    | | | WHERE hwp.topic_id = hwt.topic_id) as topic
    | | | FROM health.publish_document hwp
    | | | WHERE hwp.publish_document_id IN (13729, 1033, 11695)
    | | | </xsql:query>
    | | |
    | | |
    | | | I'm using this in combination with a XSLT and get this output -
    | Beautiful!
    | | -
    | | | just what I want, less my LONG body field :
    | | |
    | | | <?xml version="1.0" encoding="UTF-8"?>
    | | | <CONTENT>
    | | |
    | | |
    | |
    | <URL>http://healthecare140:7601/medical/medicalDocument.jsp?page=medical&#38
    | | | ;topic=10744&#38;item=7</URL>
    | | | <TITLE>Graft versus Host Disease</TITLE>
    | | | <RANK1>
    | | | <RANK1_DSCR>GVHD</RANK1_DSCR>
    | | | </RANK1>
    | | | <RANK2/>
    | | | <RANK3>
    | | | <RANK3_DSCR>Rare Disorders</RANK3_DSCR>
    | | | </RANK3>
    | | |
    | | |
    | |
    | <URL>http://healthecare140:7601/medical/medicalDocument.jsp?page=medical&#38
    | | | ;topic=910&#38;item=4</URL>
    | | | <TITLE>Hypnosis</TITLE>
    | | | <RANK1/>
    | | | <RANK2>
    | | | <RANK2_DSCR>Hypnotherapy</RANK2_DSCR>
    | | | </RANK2>
    | | | <RANK3/>
    | | |
    | | |
    | |
    | <URL>http://healthecare140:7601/medical/medicalDocument.jsp?page=medical&#38
    | | | ;topic=12344&#38;item=9</URL>
    | | | <TITLE>Low Back Problems -- Computerized axial tomography (CAT scan,
    | | | CT scan)</TITLE>
    | | | <RANK1>
    | | | <RANK1_DSCR>CT scan (computerized tomography),
    | | | back</RANK1_DSCR>
    | | | <RANK1_DSCR>CT scan, back</RANK1_DSCR>
    | | | <RANK1_DSCR>Back, CT scan of</RANK1_DSCR>
    | | | <RANK1_DSCR>Computed axial tomography (CAT) scan,
    | | | back</RANK1_DSCR>
    | | | </RANK1>
    | | | <RANK2/>
    | | | <RANK3/>
    | | | </CONTENT>
    | | |
    | | |
    | | | BUT, as soon as I add the LONG body field into the query (in BOLD):
    | | |
    | | | <?xml version="1.0"?>
    | | | <!-- healthwise_xslt.xsql -->
    | | | <xsql:query
    | | | xmlns:xsql="urn:oracle-xsql"
    | | | connection="healthwise_dev2"
    | | | max-rows="22050" >
    | | |
    | | | SELECT hwp.publish_document_id, hwp.topic_id, hwp.section_id,
    | hwp.body,
    | | | <--------- hwp.body is the LONG
    | | | CURSOR( SELECT hws.name as section_name
    | | | FROM health.section hws
    | | | WHERE hwp.section_id = hws.section_id) as section,
    | | | CURSOR( SELECT hwk.name as keyword_name
    | | | FROM health.keyword hwk, health.map_keyword_object
    | | | hwmko, health.object hwo
    | | | WHERE (hwp.publish_document_id =
    | | | hwo.publish_document_id) and
    | | | (hwo.object_id = hwmko.object_id) and
    | | | (hwmko.keyword_id = hwk.keyword_id) ) as keywords,
    | | | CURSOR( SELECT hwt.name as topic_name,
    | | | CURSOR( SELECT hwts.name as topic_synonym_name
    | | | FROM health.topic_synonym hwts
    | | | WHERE hwt.topic_id = hwts.topic_id) as
    | | | topic_synonyms,
    | | | CURSOR( SELECT hwc.name as catagory_name
    | | | FROM health.category hwc,
    | | health.map_category_topic
    | | | hwmct
    | | | WHERE (hwt.topic_id = hwmct.topic_id) and
    | | | (hwmct.category_id = hwc.category_id) ) as catagories
    | | | FROM health.topic hwt
    | | | WHERE hwp.topic_id = hwt.topic_id) as topic, hwp.body
    | | | <---------------- I tried it here too
    | | | FROM health.publish_document hwp
    | | | WHERE hwp.pu blish_document_id IN (13729, 1033, 11695)
    | | | </xsql:query>
    | | |
    | | |
    | | | I get this error:
    | | | oracle.xml.sql.OracleXMLSQLException: Stream has already been closed
    | | |
    | | |
    | | | However, this works:
    | | |
    | | | <?xml version="1.0"?>
    | | | <!-- healthwise_xslt.xsql -->
    | | | <xsql:query
    | | | xmlns:xsql="urn:oracle-xsql"
    | | | connection="healthwise_dev2"
    | | | max-rows="22050" >
    | | |
    | | | SELECT hwp.publish_document_id, hwp.topic_id, hwp.section_id, hwp.body
    | | | <--------- hwp.body is the LONG
    | | | FROM health.publish_document hwp
    | | | WHERE hwp.publish_document_id IN (13729, 1033, 11695)
    | | | </xsql:query>
    | | |
    | | |
    | | | Do I have to pull this out into code and stream the long into a string
    | and
    | | | build a DOM and then go to XML from that? Or something along those
    | lines?
    | | | And if this is the case, can you point me to some sample code.
    | | | I don't have the option of changing the LONG to something that doesn't
    | | have
    | | | to be streamed as suggested in this
    | | |
    | |
    | doc(http://technet.oracle.com/doc/oracle8i_816/java.816/a81354/basic4.htm).
    | | |
    | | |
    | | | If we can come to a conclusion on this, I will be the xsql-long
    | evangelist
    | | | on the board!
    | | |
    | | | Thank-you for you time,
    | | | chad. <[email protected]>
    | | |
    | | |
    | |
    |
    null

    Just wanted to post Steve's response to this question, in case others have problems with LONG data types and CURSORS in their .xsql queries (thanks Steve!):
    I can reproduce the problem with your testcase.
    I've filed Bug Number 1472008.
    You can workaround the problem by using CLOB
    instead of LONG in your table.
    You can use to TO_LOB() function in a CREATE TABLE...AS SELECT...
    or in an INSERT INTO TABLE...SELECT... to easily
    convert existing LONG content into CLOBs.
    null

  • Can switching from CRT to LCD monitors cause system problems?

    My 9.1 locks up periodically (but the cursor still moves) since I replaced two 20" CRT monitors with two Samsung 19" LCD monitors. Could this affect the performance of my machine? I've tried everything else to address the freeze problem but recall the issue started when I installed the LCD monitors. Anything I can do?

    Studedot,
    You may have issues with the amount of video memory depending on the resolutions of the new LCD screens.
    I find LCD screens go up to insane resolutions, way more than the corresponding size CRT monitor, ie. a 17in Dell LCD monitor with higher resolution than a 21in CRT.
    It shouldn't cause crashes or freezes, but may cause -redraw problems when closing / moving windows in 2D and playing 3D games.

Maybe you are looking for

  • How to fix CS6 from crashing when trying to save as/export as an .idml file?

    Tried the old faithful of restarting etc and using a single page with not styles etc or anything really, the most basic file but everytime CS6 keeps crashing. Any pointers on how to try and work around this? Running CS6 on 10.9.4

  • Performance issue with the table use vrkpa

    Hi. here is the selection criteria that i am using and the table use vrkpa i only used to map the table kna1 and vbrk.vbrk and kna1 doesnot have the direct primary key relationship. please check and let me know wht this vrkpa is taking time and how c

  • Recent Document Loader, addEventListener with dynamic functions.

    I have an application which I am trying to display a list of recent documents, that you can click on to open them. So far they display but only the last item gets the new event and works. Here is the code that I use to generate the call. The code is

  • No screen or anything else

    Yesterday my computer messed up.  Last night I bought the MSI K8T NEO motherboard, an AMD 64 3000 cpu, an Antec TruePower 430v power supply, a Radeon 9600 video card, and a 1 gig PC3200 stick of memory.  I put all that in to my computer and get nothi

  • New update ios6 problems

    Updated to the newest version of ios6 and I swear it gives me nothing but trouble with apps,wifi, playback of downloads. For example both my netflix and hulu apps stopped working. Anyone else having the same issues or have any ideas of how to fix?