|
-
Jun 1st, 2000, 09:28 AM
#1
Thread Starter
Lively Member
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
The blessing of God enriches and it doesn't increase pains
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|