Cursor

xiaoxiao2021-04-03  227

Declare @branch_id as varchar (100), @ branch_desc as varchar (100)

Declare @CU_OBJ CURSOR SET @cu_obj = CURSOR LOCAL SCROLL for

SELECT BRANCH_ID, BRANCH_DESC from SMS_BRANCH

Open @cu_obj fetch next from @cu_obj @ Branch_id, @ branch_desc

While @@ fetch_status = 0 Begin

Fetch next from @cu_obj @branch_id, @BRANCH_DESC SELECT @ branch_id, @ branch_desc end

Close @cu_obj

转载请注明原文地址:https://www.9cbs.com/read-131643.html

New Post(0)