PL/SQL Exceptions on Update/Delete of non-existing row

后端 未结 3 900
太阳男子
太阳男子 2021-02-19 10:10

I am learning PL/SQL these days and currently working with Procedures and exceptions using oracle HR schema.

Here is my simple procedure.

create or rep         


        
3条回答
  •  情话喂你
    2021-02-19 11:01

    There is no "exception" - the sql executed successfully. It successfully deleted every record that matched the criteria...which was 0 records. Same thing if a similar update statement was executed. You used the SQL%NOTFOUND to determine there were no records that were affected, but this does not mean there was an "exception".

    Perhaps you're thinking of the NO_DATA_FOUND Exception raised if you try a "select into" clause and it doesn't find any matching records.

提交回复
热议问题