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)
 IN Clause While Opening A Cursor

Author  Topic 

sunila7
Starting Member

2 Posts

Posted - 2001-05-21 : 11:19:29
I am trying to use in clause while opening a Cursor in a Stored procedure. is it possible.
The Stored procedure i used looks like this

CREATE PROCEDURE Hello AS
Declare @ChargetypeCode as Char(3)

Declare @Description as char(100)
set @ChargeTypeCode = 'BPF'+"," +'SOP'

--print (@ChargeTypeCode)
Declare Chargetype cursor for
select stockid from charge where chargetypecode in (@ChargeTypeCode)

open ChargeType

BEGIN
FETCH NEXT FROM Chargetype INTO @Description
WHILE @@FETCH_STATUS = 0
BEGIN
print @Description
END
FETCH NEXT FROM Chargetype INTO @Description
END
Close chargetype
Deallocate ChargeType


Thanks in Advance

Sunil



   

- Advertisement -