그동안 바빠서 손 못대다가
어제 만들어봤는데요
잘 안되네요...
머가 문제인지 좀 봐주세요. 계속 돌기만 하구 종료가
안되네요...
/*///////////////////////////////////////
DECLARE @stroid char(60),@oid char(40),@addpoint int, @member
int
DECLARE tbOrder_cursor CURSOR FOR
select '주문 적립금 ('+order_date+seq+')' as stroid,order_date+seq
as oid,addpoint, member from tbOrder where registdate <
dateadd(hour, -24, getdate())
OPEN tbOrder_cursor
FETCH NEXT FROM tbOrder_cursor
INTO @stroid,@oid,@addpoint, @member
WHILE @@FETCH_STATUS = 0
BEGIN
update tbOrder set state=5 ,completedate=getdate() where state =
4 and order_date+seq=@oid
exec csp_setPoint @member, 1, @addpoint, @oid
exec csp_setMPoint @member, 1, @addpoint
FETCH NEXT FROM tbOrder_cursor
INTO @stroid,@oid,@addpoint, @member
END
CLOSE tbOrder_cursor
DEALLOCATE tbOrder_cursor
GO
|