25 agosto 2008

DECLARE CurItens --Nome do cursor
CURSOR FOR select grpu_id_grupopublic,abmi_tx_nivel4 from #temporario where abmi_tx_nivel4 is not null
DECLARE @grpu_id_grupopublic4 integer,@abmi_tx_nivel4 varchar(100)
OPEN CurItens
FETCH NEXT FROM CurItens INTO @grpu_id_grupopublic4 ,@abmi_tx_nivel4
WHILE @@FETCH_STATUS = 0BEGIN update #temporario set abmi_tx_nivel4 = @abmi_tx_nivel4 where GRPU_ID_GRUPOpai = @grpu_id_grupopublic4
FETCH NEXT FROM CurItens INTO @grpu_id_grupopublic4,@abmi_tx_nivel4END
CLOSE CurItens
DEALLOCATE CurItens