Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Possible to get valid recordcount with MSDAORA?

Re: Possible to get valid recordcount with MSDAORA?

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Sat, 14 Feb 2004 04:59:42 GMT
Message-ID: <2XhXb.32119$uV3.57271@attbi_s51>

"Greg Rodenroth" <g-rodenroth_at_ti.com> wrote in message news:c0j9er$e79$1_at_home.itg.ti.com...
> I check the rowcount after I have executed the ADO open command. I know I
> can count the records with code, but I used to be able to check the
> recordcount property for the recordset and it would retrieve a legitimate
> number. (This was when my data was in Access. I'm migrating it to Oracle.)
> I don't believe the driver is broken, because it is retrieving my data, it
> just won't utilize the recordcount property correctly if I use a server
side
> cursor.
>
> "Jim Kennedy" <kennedy-downwithspammersfamily_at_attbi.net> wrote in message
> news:6GXWb.17819$_44.23251_at_attbi_s52...
> >
> > "Greg Rodenroth" <g-rodenroth_at_ti.com> wrote in message
> > news:c0gl4k$t69$1_at_home.itg.ti.com...
> > > But I do retrieve them. The records themselves display on my ASP page
> > even
> > > with a server side cursor. The only problem is that the recordcount
> > > property is always -1. If I change the cursor to client side, then
the
> > > recordcount property reads correctly.
> > >
> > >
> > > "Jim Kennedy" <kennedy-downwithspammersfamily_at_attbi.net> wrote in
> message
> > > news:CcNWb.14654$_44.18612_at_attbi_s52...
> > > >
> > > > "Greg Rodenroth" <g-rodenroth_at_ti.com> wrote in message
> > > > news:c0g5as$r4k$1_at_home.itg.ti.com...
> > > > > All,
> > > > >
> > > > > I am trying to get a valid recordcount using MSDAORA as a
provider.
> > All
> > > > > cursor types (forward, static, dynamic, keyset) return a -1 when
> using
> > a
> > > > > server side cursor. When I use a client side cursor, the
> recordcount
> > is
> > > > > correct, however, some of my recordsets are sizeable, and the
client
> > > side
> > > > > transfer takes up noticeable processing time.
> > > > >
> > > > > Any thoughts?
> > > > >
> > > > >
> > > > Simple, it can't know how many records there are until they are
> > retrieved.
> > > > If you actually retrieve them then the count is known.
> > > > Jim
> > > >
> > > >
> > >
> > >
> > Do you check the rowcount AFTER you retrieve them or before? And if
after
> > then you could just count them yourself.(If rowcount is -1 after you
> > retrieve the rows then the driver is broken.)
> > Jim
> >
> >
>
>

You need to read the docs. You won't get a "correct" count until after you fetch the data from the server. Executing the query does NOT fetch the data; it just sets up the execution plan and the memory areas on the server for the query. It does NOT actually fetch the rows until you fetch them. On a client side cursor you have fetched all the rows into the memory of the client and thus you know the count at that point. (because you actually fetched all the data). You should read the application developer's guide for OCI to get a highlight of how these things work under the covers. Jim Received on Fri Feb 13 2004 - 22:59:42 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US