114
@@Count1 timyint,
@@Var1 money
SET @@Count = 1
SET @@Var1 = 0
WHILE @@Count1 <@@CURSOR_ROWS
BEGIN
IF @@Count = 1
FETCH ABSOLUTE 1 FROM CURS INTO @@VFName,
@@VLName, @@VPhone, @@VTitle, @@VPrice,
@@VAdrance, @@VSales
ELSE
FETCH curs INTO @@VFName,
@@VLName, @@VPhone, @@VTitle, @@VPrice,
@@VAdrance, @@VSales
SET @@Count1 = @@Count1+1
SET @@Var1 = @@Var1+@@Vprice*@@VSales-@@VAdrance
END
SELECT ‘Итого прибыли:’, @@Var1
4. Курсорды босату және жабу:
CLOSE curs
DEALLOCATE curs.
Достарыңызбен бөлісу: