Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> embedded SELECT problem

embedded SELECT problem

From: Oleg <oleg_at_itv.net>
Date: Fri, 29 Sep 2000 13:58:13 -0700
Message-ID: <39D50265.F0FBC40A@itv.net>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US