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

Home -> Community -> Usenet -> c.d.o.misc -> update with subselect

update with subselect

From: Tom <tomsonn_at_gmx.net>
Date: 21 Sep 2001 09:23:44 -0700
Message-ID: <e6ec512f.0109210823.3bcc0730@posting.google.com>


Hi everybody,

I've got the following update-stmt:

update

   rep_account
set

   rep_account.percentage =

     rep_account.debit / 
        ( select 
            rep_cover.total_balance_all 
         from 
            rep_cover 
         where 
            rep_cover.internalid = rep_account.rcv_internalid  )
      * 100 
where
       rep_account.rcv_internalid   = ext_rcv_row.internalid
   and rep_account.pos_id          in ( pkg_gloconst.pos_ccy_balance,
                                       

pkg_gloconst.pos_accountbalance_all )
;

It works fine if I run it in SQL-Plus, but if I try to compile it into a procedure I alway get the error:

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>

PLS-00103: Encountered the symbol "*" when expecting one of the following:

ERROR



; return returning and or

thanx in advance
Tom Received on Fri Sep 21 2001 - 11:23:44 CDT

Original text of this message

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