Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> embedded SELECT problem
Hello, All
I’m trying to create function that updates field “x†of table “t†and set it to the value selected from another table replacing NULL by 0.
create or replace procedure f(i in int) is
begin
update t set x=NVL((select 1 from dual),0);
end;
This script returns compile time error: “PLS-00103: Encountered the symbol "SELECT" when expecting one of the following: ( - + mod not null others <an identifier>…â€.
“update†by itself runs well and returns “0 rows updatedâ€, but I’d like to have function.
Why it does not work and how can I solve this problem in single “update�
Thanks. Received on Fri Sep 29 2000 - 15:58:13 CDT