How to stop the compiler from selecting inactive indexes?
How to prevent error 995 when the database contains inactive indexes?
The compiler will consider all indexes (active or inactive) during compilation.
If the compiler chooses an inactive index, and that index is still inactive when the program is run, then it will result with the error 995 during runtime
Index <index-name> is inactive and cannot be referenced. (995)
If the compiler chooses an inactive index for a TEMP-TABLE, the code fails with compile error:
"Inactive <index> cannot be used for TEMP-TABLE <name>. You must use USE-INDEX to specify the active indexes to use for the TEMP-TABLE, or use the startup option -noinactiveidx. (3388)".
To force the compiler to ignore inactive indexes use the
-noinactiveidx startup parameter.