커서를 생성한후 커서가 만들어낸 레코드의 갯수를 알고싶습니다.
10개면 10을 반환하는 값이 없나요?
DECLARE work_cursor CURSOR FOR
select workid, workday, workgubun, daygubun, sgubun, fgubun,
c_earlytime, c_nortime, c_exttime, c_nighttime, c_holtime, c_addtime
from employee_work
where empid = @empid and left(workday,7) = @yyyymm
OPEN work_cursor
FETCH NEXT FROM work_cursor INTO @workid, @workday, @workgubun, @daygubun,
@sgubun, @fgubun, @c_earlytime, @c_nortime, @c_exttime, @c_nighttime,
@c_holtime, @c_addtime
WHILE @@FETCH_STATUS = 0
BEGIN
FETCH NEXT FROM work_cursor INTO @workid, @workday, @workgubun, @daygubun,
@sgubun, @fgubun, @c_earlytime, @c_nortime, @c_exttime, @c_nighttime,
@c_holtime, @c_addtime
END
레코드수를 어찌 알지요?
|