| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: update with subselect
At the very least, you will need to define a cursor to do the select ( the PlSql code is actually a Fetch of a cursor, not a 'direct' select as it is in SqlPlus) but there is more involved in creating a procedure than just attempting to compile a SqlPlus script...
See the PlSql documentation for more info...
tomsonn_at_gmx.net (Tom) wrote:
>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
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! Check out our new Unlimited Server. No Download or Time Limits! -----== Over 80,000 Newsgroups - 19 Different Servers! ==----- Received on Fri Sep 21 2001 - 12:48:27 CDT
![]() |
![]() |