Dynamic SQL

From: arnaud herve <dillonais_at_wanadoo.fr>
Date: Sun, 13 Oct 2002 10:50:44 +0200
Message-ID: <aobc2h$lso$1_at_news-reader10.wanadoo.fr>


I've a table T like that
X Y



A NULL
NULL C
D E
F NULL My Problem.
I want to replace values equal to NULL by the value which follow them In my case, I'll get.
A C
D C
D E
F NULL
I used a curosr but how to make a dynamic update?

according to me,It would be like



.........
for i in 1..sql%rowcount-1 loop
if X is null
update T set X = select X from T
where rownum = i+1;
end loop;
..........

it's a sample of code, I know a dirty code, but simply to show you, what I want to get. Received on Sun Oct 13 2002 - 10:50:44 CEST

Original text of this message