cancel
Showing results for 
Search instead for 
Did you mean: 

How to Handle exception?

italo_naia
Participant
0 Kudos

Hi All,

   In my procedure I have this select:

       Select col1, col2 into v_col1, v_col2 where col3 = 'TEST' limit 1;

  How to handle no_data_found Exception?

  I don't found nothing about it.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

Hi Italo,

for specifically this requirement, you can employ cursors and check after opening the cursor and fetching some data whether <cursorname>::NOTFOUND is true.

There's an example for this in the developer guide.

For just looping over the result set, you will be better off with the

FOR <row> as <cursor> DO

END FOR;

construct.

General error handling is currently not documented for SQLScript.

- Lars

italo_naia
Participant
0 Kudos

Hi Lars,

  I was just wondering if exception handling exists, to avoid use cursor to return 1 line.

Thank you.

Answers (0)