# Rule 2131: Use CONSTANT wrong for CURSOR declaration

**URL:** <https://forums.toadworld.com/t/rule-2131-use-constant-wrong-for-cursor-declaration/54050>\
**Category:** Toad for Oracle - Beta\
**Created:** [November 8, 2021, 8:26am UTC](https://forums.toadworld.com/t/rule-2131-use-constant-wrong-for-cursor-declaration/54050 "2021-11-08T08:26:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeterLang](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@PeterLang](https://forums.toadworld.com/u/PeterLang)\
**Post date:** [November 8, 2021, 8:26am UTC](https://forums.toadworld.com/t/rule-2131-use-constant-wrong-for-cursor-declaration/54050/1 "2021-11-08T08:26:25Z")

</div>

Cursors cannot be declared as CONSTANT:

![image](https://global.discourse-cdn.com/quest/original/2X/d/d181470c1047d773b09bc38c6dcecec1dfb2538b.png)

  

**Example:**

```auto
DECLARE
  cur1 SYS_REFCURSOR;

  TYPE t_cur IS REF CURSOR RETURN dual%ROWTYPE;
  cur2 t_cur;
BEGIN
  OPEN cur1 FOR SELECT * FROM dual;
  CLOSE cur1;

  OPEN cur2 FOR SELECT * FROM dual;
  CLOSE cur2;
END;

```

---

<div class="post-metadata">

**Author:** ![avergison](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/avergison/32/66_2.png) [@avergison](https://forums.toadworld.com/u/avergison)\
**Post date:** [November 8, 2021, 9:03pm UTC](https://forums.toadworld.com/t/rule-2131-use-constant-wrong-for-cursor-declaration/54050/2 "2021-11-08T21:03:31Z")

</div>

Thanks Peter.  
Changing the list in line 2 of the expression to (ASSIGN/LHS, INTO\_LIST, PARAM, OPEN, CLOSE, FETCH) should work.  
I'll change that here as well. (QP-3901)

Thanks,  
Andre
