IBM Support

Error -285 running a stored procedure or function

Troubleshooting


Problem

You are running a stored procedure or function using cursors ( implicitly or explicitly ) then see error 285.

Cause

-285 Invalid cursor received by sqlexec.

The cursor that this statement uses has not been properly declared or
prepared, or the FREE statement has released it, or an automatic re-prepare
has been attempted while opening the cursor but that operation failed,
leaving the cursor unavailable. Review the program logic to ensure that the
cursor has been declared. If it has, and if the DECLARE statement refers to
a statement identifier, check that the referenced statement has been prepared.

Resolving The Problem

  • Look for and correct possible causes listed in the Cause section of this document.
  • Check the stored procedure or function code for areas of improvement regarding cursors like explicitly beginning and ending foreach loops.
  • Set AUTO_REPREPARE to 0 in the ONCONFIG.

[{"Product":{"code":"SSGU8G","label":"Informix Servers"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"--","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF022","label":"OS X"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"11.5;11.7;12.1","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
16 June 2018

UID

swg21687439