# Singlestore Database can we write Cursor with exception handling of EXCEPTION WHEN ER\_INTO\_VARIABLES\_NO\_ROWS THEN

**URL:** <https://www.singlestore.com/forum/t/singlestore-database-can-we-write-cursor-with-exception-handling-of-exception-when-er-into-variables-no-rows-then/6971>\
**Category:** SingleStore Experiments\
**Tags:** developer\
**Created:** [July 12, 2023, 9:47am UTC](https://www.singlestore.com/forum/t/singlestore-database-can-we-write-cursor-with-exception-handling-of-exception-when-er-into-variables-no-rows-then/6971 "2023-07-12T09:47:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nani](https://www.singlestore.com/forum/letter_avatar_proxy/v4/letter/n/58956e/32.png) [@Nani](https://www.singlestore.com/forum/u/Nani)\
**Post date:** [July 12, 2023, 9:47am UTC](https://www.singlestore.com/forum/t/singlestore-database-can-we-write-cursor-with-exception-handling-of-exception-when-er-into-variables-no-rows-then/6971/1 "2023-07-12T09:47:34Z")

</div>

Can we get a example with cursor procedure with EXCEPTION:  
qry QUERY(id\_curs text)=select distinct EMP\_ID from EMP\_DETAILS;  
BEGIN  
EXCEPTION  
WHEN ER\_INTO\_VARIABLES\_NO\_ROWS THEN in cursor procedure.  
Because i am unable to write in singlestore and its throwing unhandled errors.  
please help me to get this.

---

<div class="post-metadata">

**Author:** ![michael.arthur](https://www.singlestore.com/forum/user_avatar/www.singlestore.com/michael.arthur/32/1452_2.png) [@michael.arthur](https://www.singlestore.com/forum/u/michael.arthur)\
**Post date:** [July 12, 2023, 11:59pm UTC](https://www.singlestore.com/forum/t/singlestore-database-can-we-write-cursor-with-exception-handling-of-exception-when-er-into-variables-no-rows-then/6971/2 "2023-07-12T23:59:24Z")

</div>

See if this helps:

> [@A example with cursor procedure with EXCEPTION HANDLING of ER\_INTO\_VARIABLES\_NO\_ROWS](https://www.singlestore.com/forum/t/a-example-with-cursor-procedure-with-exception-handling-of-er-into-variables-no-rows/6972):
>
> Can we get a example with cursor procedure with EXCEPTION: qry QUERY(id\_curs text)=select distinct EMP\_ID from EMP\_DETAILS; BEGIN EXCEPTION WHEN ER\_INTO\_VARIABLES\_NO\_ROWS THEN in cursor procedure. Because i am unable to write in singlestore and its throwing unhandled errors. please help me to get this.
