what exactly is this all doing?
declare @Total int, @counter int, @cost int, @PartNum int
declare myCursor Cursor
Local
for select PartNum, cost from Inventory
open myCursor
select @total = count(PartNum) from inventory
set @counter = 1
while @counter <= @total
Begin
fetch myCursor into @PartNum, @Cost
if @cost > 50
print 'PartNum' + rtrim(@PartNum)+ 'Cost is greater than 50'
else
print 'PartNum' + rtrim(@PartNum)+ 'Cost is less than 50'
set @counter=@counter + 1
End
close myCursor
Deallocate myCursor
thanks
~zzzzzeke
declare @Total int, @counter int, @cost int, @PartNum int
declare myCursor Cursor
Local
for select PartNum, cost from Inventory
open myCursor
select @total = count(PartNum) from inventory
set @counter = 1
while @counter <= @total
Begin
fetch myCursor into @PartNum, @Cost
if @cost > 50
print 'PartNum' + rtrim(@PartNum)+ 'Cost is greater than 50'
else
print 'PartNum' + rtrim(@PartNum)+ 'Cost is less than 50'
set @counter=@counter + 1
End
close myCursor
Deallocate myCursor
thanks
~zzzzzeke