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 -> Re: update with subselect

Re: update with subselect

From: TurkBear <noone_at_nowhere.com>
Date: Fri, 21 Sep 2001 12:48:27 -0500
Message-ID: <40vmqt8anhq5v741pkmfo8s7p9qqa3bj0p@4ax.com>

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

Original text of this message

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