We're on IDS 9.21 UC5, and I run a script every 2 minutes that connects to our database and does a select out of one of the tables, then checks the return code. Periodically I am finding a return code of 255. Any ideas what this means?
It means either you have forgot begin/commit work or may be your database is not in logging mode (buff or un-buff or ansi). See below
: finderr 255
-255 Not in transaction.
The database server cannot execute this COMMIT WORK or ROLLBACK WORK
statement because no BEGIN WORK was executed to start a transaction.
Because no transaction was started, you cannot end one. Any database
modifications that were made are now permanent; they cannot be rolled
back but do not need to be committed. Review the sequence of SQL
statements to see where the transaction should have started.
This error can occur when you open a cursor for update and have not started
a transaction yet.
It is not correct, nitin_math.
As program, dbaccess does exit() function on finish. Some convention in C programming states that programs which finish correctly returns 0. On the other hand, programs which causes errors should return less then 0.
This 255 is in fact -1 if you present it as one byte.
For "real" informix error you should parse output of sql script.