ADO cursor issue with stored proc. 
Author Message
 ADO cursor issue with stored proc.

Hi,

know actual record count from table, then you would still need to use SELECT
COUNT(*) FROM TableName

--
Val Mazur
Microsoft MVP


Quote:
> Hi,
>    I'm currently developing a app that needs to page through results,
> results which occur in the thousands. I need to know how many records
> there are, so I can display the count and calculate the page count.
>   Currently I invoke the same query twice, once for the data and again
> for the count.
> so I have something like.
>   select cid, name, message, charge from tableorgs where ....
>   select count(*) from tableorgs where...

>  This is a bit slow on really large results. Using ADO if I try and make


> cannot invoke the pageing facilities of the cursor..apparently a
> foward-only cursor which doesn't do bookmarking is created. bummer.

>   Anybody know a way to do this, so I don't invoke the complex query
> twice on the DB?

> Thanks.
> Salik.



Sun, 06 Feb 2005 03:58:11 GMT  
 ADO cursor issue with stored proc.
Hi,

As I know you cannot get values from output parameters until you proceed
your recordset. In your case, if you have forward-only cursor, it means that
you will get return value only after you finish to work with recordset. I
think it will be faster to dump records from SP into temp recordset and get
actual record count from it. Then do what you need.

--
Val Mazur
Microsoft MVP


Quote:
> I'm not counting the table , but the results of a query.

> Salik.


> > Hi,


to
> > know actual record count from table, then you would still need to use
SELECT
> > COUNT(*) FROM TableName

> > --
> > Val Mazur
> > Microsoft MVP



> > > Hi,
> > >    I'm currently developing a app that needs to page through results,
> > > results which occur in the thousands. I need to know how many records
> > > there are, so I can display the count and calculate the page count.
> > >   Currently I invoke the same query twice, once for the data and again
> > > for the count.
> > > so I have something like.
> > >   select cid, name, message, charge from tableorgs where ....
> > >   select count(*) from tableorgs where...

> > >  This is a bit slow on really large results. Using ADO if I try and
make


> > > cannot invoke the pageing facilities of the cursor..apparently a
> > > foward-only cursor which doesn't do bookmarking is created. bummer.

> > >   Anybody know a way to do this, so I don't invoke the complex query
> > > twice on the DB?

> > > Thanks.
> > > Salik.



Sun, 06 Feb 2005 04:54:37 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Issue? Stored Proc Param w/Crystal 6.0

2. sql server cursors as stored proc output params?

3. CAlling an Oracle Stored Proc with ADO.Net via VB

4. Problem opening recordset for update ADO 2.1/Jet 4.0/Access 2000 stored proc

5. Stored Proc Return values / Output Params w ADO and SQL Server 7

6. ADO Stored Proc...AAAAAAAAAAAARRG please help

7. ADO Errors from Sybase Store Proc.

8. ADO and Sybase Stored Proc Resultset ?

9. Returning Recordsets with ADO from Oracle stored proc

10. Stored Proc Return values / Output Params w ADO and SQL Server 7

11. ADO and Sybase Stored Proc Resultset ?

12. Stored proc on Informix returning decimal using ADO

 

 
Powered by phpBB® Forum Software