Hi


I have a declared cursor this way:
CREATE PROCEDURE mystore AS

declare @EmpId integer
declare @worder int
declare @wcliente nchar(4)
declare @wFunc int
declare @wdata datetime
declare mycursor SCROLL cursor
for
select orderid,customerid,EmployeeId,orderdate
from orders
where EmployeeId = @EmpId

select @EmpId =3

while @EmpId<=4
begin
open mycursor
fetch next from mycursor into @worder,@wcliente ,@wfunc,@Wdata
while @@fetch_status = 0
begin
print @worder
fetch next from mycursor into @worder,@wcliente ,@wfunc,@Wdata
end
close mycursor
select @EmpId = @EmpId +1
print @EmpId
end
close mycursor
deallocate mycursor



I want to vary the variable @EmpId, this routine is only a test to see if it works, I caught these data of the bank NORTHWIND of the table ORDERS. Doesn't he come back any given, what is wrong?

I am in advance grateful