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 -> Re: Bug or Misunderstanding ? Delete...Returning into does not work as I expected

Re: Bug or Misunderstanding ? Delete...Returning into does not work as I expected

From: Paul Brewer <paul_at_paul.brewers.org.uk>
Date: Tue, 4 Feb 2003 19:11:44 -0000
Message-ID: <3e402018$1_2@mk-nntp-1.news.uk.worldonline.com>


"FC" <flavio_at_tin.it> wrote in message
news:CBT%9.180453$AA2.7097288_at_news2.tin.it...
> Hello folks,
> I just ask you whether I misunderstood the documentation or it's a PL/SQL
> bug.
> Facts:
> Oracle 8.1.7.0.0 EE, Windows 2000 Pro.
>
> ...
> Delete from configurations
> where cfg = num_cfg -- this is
a
> PK on table
> returning cfg_dsc into var_cfg_description;
> ...
>
> Now, I would expect an exception like NO_DATA_FOUND to be raised if
num_cfg
> does not match any existing record, because the returning clause cannot
> return any value, but this doesn't happen.
>
> Of course there are simple workarounds if one needs to raise an error but
I
> didn't find any comment about this behaviour in the PLSQL user's guide and
> reference, is this normal?
>
> Bye,
> Flavio
>
>

Absolutely normal, IMHO.

Delete from emp where 'true' = 'false';
Update emp set salary = salary * 2 where 0 = 1;

These are both perfectly legitimate. It just so happens that no rows meet the criteria.

You need to check sql%rowcount.

Regards,
Paul Received on Tue Feb 04 2003 - 13:11:44 CST

Original text of this message

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