Board index » delphi » Multi-statement query (error creating cursor handle)

Multi-statement query (error creating cursor handle)

I have a query that is done in several steps.  The first two steps use
select statements to build temporary tables, the third joins the two
temporary tables to return a result set.  The problem is that when I try
and use the open method for the query component I get an error (error
creating cursor handle).  I think this is because the first two steps
return no result sets.
       Does anyone have a suggestion on how I might solve this problem?

Thanks,

Ted Power

 

Re:Multi-statement query (error creating cursor handle)


What database?  Generally speaking you can't do this, but Oracle is an
exception.

John PIerce

Re:Multi-statement query (error creating cursor handle)


MSSQL 6.5
Quote
John Pierce wrote:
> What database?  Generally speaking you can't do this, but Oracle is an
> exception.

> John PIerce

Re:Multi-statement query (error creating cursor handle)


I would suggest using a TStoredProc and a stored procedure on the server
which returns a result set. Use your TStoredProc as a dataset (instead of
TQuery), and call open instead of execproc.

--

Alain Quesnel
cinqsanss...@compuserve.com

------------

Quote
"Ted Powers" <pow...@nbnet.nb.ca> wrote in message

news:39477723.CAEC159F@nbnet.nb.ca...
Quote
> I have a query that is done in several steps.  The first two steps use
> select statements to build temporary tables, the third joins the two
> temporary tables to return a result set.  The problem is that when I try
> and use the open method for the query component I get an error (error
> creating cursor handle).  I think this is because the first two steps
> return no result sets.

>        Does anyone have a suggestion on how I might solve this problem?

> Thanks,

> Ted Power

Re:Multi-statement query (error creating cursor handle)


That was  many years ago. Now many can do it, MSSQL, Sybase, SQL
anywhere,...
To answer the original question:
This usually happens if you omit statement delimiter.

--
----------------------
Regards
Robert Cerny
Remove both qwe when replying
email: robert.qwe.ce...@neosys.xrs.qwe.si
No questions via email, unless explicitly invited.

Quote
John Pierce wrote in message <3947AA74.65FD2...@healthplanning.com>...
>What database?  Generally speaking you can't do this, but Oracle is an
>exception.

>John PIerce

Other Threads