DECLARE CursorWO CURSOR FORWARD_ONLY FOR
-------------- Start Select --------------------------
-------------- Start Select --------------------------
-------------- End Select ----------------------------
OPEN CursorWO
FETCH NEXT FROM CursorWO
INTO @WOid_Short, @WOid, @ParentItemCode, @ItemCode, @Qty, @UOM, @Action
OPEN CursorWO
FETCH NEXT FROM CursorWO
INTO @WOid_Short, @WOid, @ParentItemCode, @ItemCode, @Qty, @UOM, @Action
WHILE (@@FETCH_STATUS = 0)
BEGIN
-- do something.......
BEGIN
-- do something.......
--Get next record from cursor
FETCH NEXT FROM CursorWO
INTO @WOid_Short, @WOid, @ParentItemCode, @ItemCode, @Qty, @UOM, @Action
END
CLOSE CursorWO
DEALLOCATE CursorWO
FETCH NEXT FROM CursorWO
INTO @WOid_Short, @WOid, @ParentItemCode, @ItemCode, @Qty, @UOM, @Action
END
CLOSE CursorWO
DEALLOCATE CursorWO
No comments:
Post a Comment