Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Why this update is not working , can't I use nvl function in update st
Hi Guys,
Can anybody tell me why this update is failing , can't I use nvl
function in update while
loop thru?, please also see the errors at the end.
DECLARE
v_min_unique_num int; v_max_unique_num int; v_increment int;
v_increment := 10000;
v_min_unique_num = 1;
v_max_unique_num = 100;
while (v_min_unique_num <= v_max_unique_num) loop
update <table1>
set max_capacity = nvl( (select max (col1) from <table2>
where <table2>.col1 = <table1.col1 and
<table1.col1 in (select col1 from <table3>
where col2 = 33)), 0.0)
where <table1>.col1 between v_min_unique_num and (v_min_unique_num +
v_increment);
v_min_unique_num := v_min_unique_num + v_increment + 1;
end loop;
end;
/
PLS-00103: Encountered the symbol "SELECT" when expecting one of the
following:
( - + mod not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string>
ORA-06550: line 78, column 31: PLS-00103: Encountered the symbol "," when expecting one of the following:
![]() |
![]() |