5 Replies Latest reply on May 20, 2010 4:50 PM by gdarling - oracle

    SQL-Statement with OO4O

      Hello together,

      I have here following Problem:

      Everthime I make a connection to my database with this code

      Set oSess = Server.CreateObject("OracleInProcServer.XOraSession")
      Set oDB = oSess.DbOpenDatabase(tnsname, user/PWD, 4)

      I get always this Statement in the DB-queue

      SELECT parameter, VALUE
      FROM SYS.nls_database_parameters

      Can me anyone tell me why I get this statement and how I can disable it?

      Best Regards
        • 1. Re: SQL-Statement with OO4O
          gdarling - oracle

          The statement is issued internally by the Oracle client software to determine the characterset of database in order to know if characterset translation needs to occur before sending data across the wire. You can't disable it.

          Hope it helps,
          1 person found this helpful
          • 2. Re: SQL-Statement with OO4O
            Hi Greg,

            thank you for this a important Answer, which I don´t know.

            Now I have an another Question:

            I got a lot of open Cursor from this SQL-Statement, which will not close
            in the Database, why it is so? (eg. 200 from 1000 will not close)

            Have you therefor a answer?

            Best Regards
            • 3. Re: SQL-Statement with OO4O
              gdarling - oracle
              I'm not sure what to tell you about that. Are you getting cursor related errors (ora-1000 for example)? Or is it simply their presence in v$open_cursor for example that concerns you? Generally v$open_cursor also includes recently used cursors cached by the database.

              Anyway, I just tried the following vbscript, and was unable to reproduce your complaint. I simply queried count(*) from v$open_cursor while it ran.
              I'm using oo4o and 11.2 db, for the record.

              For mI = 1 To 5000
              Set pSession = CreateObject("OracleInProcServer.XOraSession")
              Set pDatabase = pSession.OpenDatabase("orcl", "scott/tiger", 4)
              wscript.echo mI 
              set pDatabase=nothing  
              set pSession=nothing        
              wscript.echo "done, no errors"
              • 4. Re: SQL-Statement with OO4O
                Hi GReg,

                their presence in v$open_cursor concerns me.

                I have close all Connection correctly, but I have still open cursor. But why?

                Is it possible to see from which script this statement/connection comes?

                Best Regards
                • 5. Re: SQL-Statement with OO4O
                  gdarling - oracle
                  You'd probably be better off posting that question in one of the database forums, as the DBA types can probably answer that better for you. However, I suspect they'll also answer that you don't need to concern yourself with it. As I understand it v$open_cursor also includes "recently used" cursors as well.