Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Cursor as output of Stored procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-06-17 : 12:54:49
Jyoti writes "Hello
I want a cursor as one of the parameter of the stored procedure.Can i do it? If yes then what should be the correct syntax.Also i want to call this stored procedure from visual basic 6.How should i define the parameters and how will i get the proper data.
Reply me asap.
Thank you.
Jyoti"

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2002-06-17 : 13:09:41
Stored procedures can use the cursor data type only for OUTPUT parameters. If the cursor data type is specified for a parameter, both the VARYING and OUTPUT parameters are required. If the VARYING keyword is specified for a parameter, the data type must be cursor and the OUTPUT keyword must be specified.

However the cursor data type cannot be bound to application variables through the database APIs such as OLE DB, ODBC, ADO, and DB-Library. Because OUTPUT parameters must be bound before an application can execute a stored procedure, stored procedures with cursor OUTPUT parameters cannot be called from the database APIs. These procedures can be called from Transact-SQL batches, stored procedures, or triggers only when the cursor OUTPUT variable is assigned to a Transact-SQL local cursor variable.


Go to Top of Page
   

- Advertisement -