Oracle 10.2:具有零星性质的无效游标

时间:2012-04-17 08:34:20

标签: oracle cursor

我正在处理的应用程序中的存储过程正在生成ORA 01001:零星无效的游标错误。当错误发生时,许多用户会将此错误作为响应发出,并在一段时间后,它会自行更正并且事情将恢复正常。

官方文档(Oracle 10g Documentation)中未提及此ORA01001错误。但我可以看到来自Oracle 10g的错误。 我定期监控最大开放光标,没有任何问题。 生成错误的存储过程点是一个简单的SELECT(使用隐式游标)。

编辑: 以下是代码:

l_sql_point:=12; 
If l_country_id='RU' 
Then select count(*) into l_rub_count from lcs_currency where currency_cd='RUB'; 
End If; 
Begin 
  select group_id into l_group from lcs_country where country_id=l_country_id; 
Exception when no_data_found 
  Then p_lcs_err_cd:='LCD1001'; 
       p_lcs_err_text:='Invalid Country Code - '||l_country_id; 
        p_err_text:='Invalid Country Code - '||l_country_id; --  return ret_result_set; 
End; 

我收到以下错误:xxsql_point:12----ORA-01001: invalid cursor

感谢您的宝贵帮助!

1 个答案:

答案 0 :(得分:0)

根据我的经验,如果出现以下情况,则会发生ORA-01001无效游标错误:

  • 您尝试打开已存在的打开游标
  • 您尝试在关闭或尚未打开时访问游标属性

检查您的代码库,看看是否有任何未关闭的游标&你想再次重新开放。

相关问题