UPdate de un cursor
Hola amig@s, necesito vuestra ayuda, ya que no consigo encontrar la solución a un pequeño problema.
Estoy haciendo un procedimiento almacenado en SLQ server y utilizo un cursor que declaro "for update"
necesito a la vez q leo del dicho cursor, hacer un update de una de las columnas de la fila seleccionada.
Seria algo asi
DECLARE seleccion CURSOR FOR
SELECT a, b, c
FOR update
OPEN seleccion
FETCH seleccion INTO
@a1, @b1, @c1
WHILE @@FETCH_STATUS=0
BEGIN
if j<>k
update seleccion @a=345 where current of
else
update seleccion @a=@b where current of
end
CLOSE seleccion
DEALLOCATE seleccion
GO
mas o menos, espro q se entienda,
El problema es que me da error en update seleccion @a=345 where current of
y no se como ponerlo.
A ver si me podeis ayudar
gracias a tod@s
Estoy haciendo un procedimiento almacenado en SLQ server y utilizo un cursor que declaro "for update"
necesito a la vez q leo del dicho cursor, hacer un update de una de las columnas de la fila seleccionada.
Seria algo asi
DECLARE seleccion CURSOR FOR
SELECT a, b, c
FOR update
OPEN seleccion
FETCH seleccion INTO
@a1, @b1, @c1
WHILE @@FETCH_STATUS=0
BEGIN
if j<>k
update seleccion @a=345 where current of
else
update seleccion @a=@b where current of
end
CLOSE seleccion
DEALLOCATE seleccion
GO
mas o menos, espro q se entienda,
El problema es que me da error en update seleccion @a=345 where current of
y no se como ponerlo.
A ver si me podeis ayudar
gracias a tod@s