E
E
EvgMul2017-03-22 07:54:48
SQL
EvgMul, 2017-03-22 07:54:48

How to properly handle exception in PL SQL?

Hello. I have this piece of code:

select requests.phone_contact, requests.request_id 
    into l_phone, l_request_id
    from requests where requests.phone_contact = '9129766943';
  exception when NO_DATA_FOUND then
    dbms_output.put_line('no data');
  
  DBMS_OUTPUT.PUT_LINE('test');

If the query does not find a record, both the exception message and the message below are displayed. If the exception does not fire, the console is empty.
Can you please tell me what I'm doing wrong and how to properly handle this exception?
Thanks in advance to all who respond.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Draconian, 2017-03-22
@EvgMul

From here:
The link has an example of how you can continue the execution of the script through sub-blocks.

A
Antonio Solo, 2018-01-22
@solotony

and enable debug mode?

I
Ivan Torgov, 2018-01-23
@itorgov

What's in the Laravel logs? They are in the storage/logs/ folder , if anything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question