Re: HELP with Database Cursor
Posted in 1997
Topics: Error Codes & Troubleshooting, Connectivity: ESQL/C, 4GL & Embedded SQL
At 00.02 11/02/97 GMT, you wrote: } }I have been trying to execute ESQL/C commands on a SPARC10 running 4.1.3 }with very little success. } }I have a cursor that has been PREPAREed and DESCRIBEed. The cursor is }then opened with the argument input to the program from a file received }from another site. } }This is not the only cursor that is described and used this way but they seem }to be working OK. } }The cursor is used to FETCH a record the first time around in the function, }this record is not expected to be found, the cursor is then closed and opened }again using a argument in the where clause. This record is expected to }be found on the FETCH. The return code I get from sqlca.sqlcode is -400. }Of course this code is not listed in any of the Informix manuals I have so }that is why I am posting this to the net. } }The select clause used is "select * from table1 where num = ?" } }I am running Informix-SE Version 4.13 UD1 } Informix-SQL } Informix-ESQL/C } }This is a "c" program and ran fine on a 3B2 SVR3 machine but failed when }I ported it to the SUN machine. } }I was running Informix 2.1 or close to that release. } }Any and all help will be greatly appreciated. } } }-- } } Gary T. Butler } Email network } gbutler@netcom.com } I read from Informix Error Messages - Version 7.1 - <<-400 Fetch attempeted on unopen cursor. This FETCH statement names a cursor that has never been opened, or which has been closed. Review the program logic and make sure that it will open the cursor before this point, and not accidentally close it. Be aware that unless a cursor is declared WITH HOLD, it is automatically closed by a COMMIT WORK or ROLLBACK WORK.>> Bye ____________________________________________ Paolo Mancuso - Gesi Srl - Via Rodi, 32 - 00195 ROMA - Tel. + 39 6 39743413 ____________________________________________