Hi,
I am trying to open a CURSOR in SQL SDERVER 7.0 which uses an in clause for opening the Cursor. is it possible to open a cursor like this.
The Select statement is not returning any rows now.
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 for any help
Sunil
I am trying to open a CURSOR in SQL SDERVER 7.0 which uses an in clause for opening the Cursor. is it possible to open a cursor like this.
The Select statement is not returning any rows now.
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 for any help
Sunil