# Strange error with Codexpert

**URL:** <https://forums.toadworld.com/t/strange-error-with-codexpert/10909>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [December 8, 2011, 5:57am UTC](https://forums.toadworld.com/t/strange-error-with-codexpert/10909 "2011-12-08T05:57:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ManuelC](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@ManuelC](https://forums.toadworld.com/u/ManuelC)\
**Post date:** [December 8, 2011, 5:57am UTC](https://forums.toadworld.com/t/strange-error-with-codexpert/10909/1 "2011-12-08T05:57:56Z")

</div>

Hi,  
I am checking some legacy packages with Codexpert, and experiencing a strange behaviour.  
I have a package like this ():

cursor c1 (cur\_name sometables%Type) is  
select something from sometable where somefileds = cur\_name;  
procedure someprocedure (name IN sometable%TYPE,…);  
begin  
if c1%ISOPEN then  
open c1 (name);  
end if;  
out\_batch\_size := 0;  
for myint in 1…batch\_size  
LOOP  
fetch c1 into Value\_table(myint);  
out\_batch\_size := out\_batch\_size + 1;  
EXIT WHEN c1%NOTFOUND;  
END LOOP;  
status := 0;  
close c1;

When I have those first three lines (which looks fine to me, open the cursors only if it is not yet open) the codexpert gives me back 2 errors “Ensure that any local cursors you are referencing have actually been opened” with the line “if c1%ISOPEN then”. And later a “Confirm that the cursor you are referencing has been opened” on all other lines with c1.

if I change this:  
if c1%ISOPEN then  
open c1 (name);  
end if;

to  
open c1 (name);

then it is fine.  
Someone has a suggestion?!?!?  
manuel

---

<div class="post-metadata">

**Author:** ![ManuelC](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@ManuelC](https://forums.toadworld.com/u/ManuelC)\
**Post date:** [December 8, 2011, 7:34am UTC](https://forums.toadworld.com/t/strange-error-with-codexpert/10909/2 "2011-12-08T07:34:04Z")

</div>

Sorry,  
there was a copy past error.  
The code is like this

if NOT c1%ISOPEN then  
open c1 (name);  
end if;
