Informix Error -674
-674 Routine <routine-name> cannot be resolved. </routine-name>
You called a routine that does not exist in the database, you do not have permission to execute the routine, or you called the routine with too few or too many arguments. If a prepared statement invokes a user-defined routine and your application or another application drops the routine before the prepared statement is executed, you will receive this error.
You might also see this error message if you write an expression that calls an SPL routine (stored procedure) that returns no values. For an SPL routine to be usable in an expression, the routine must return a value.
Check that the name of the routine is correct, that you have execute permission, that you specified the correct number of arguments to execute a routine, and that the data types for the arguments are appropriate. For a prepared statement that refers to the routine, make sure that the routine still exists when you execute the statement.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-674 covers several distinct underlying causes, per the official guidance: the routine doesn't
exist, the caller lacks execute permission, the call passed the wrong number of arguments, a
prepared statement's routine was dropped before execution, or an SPL routine with no
RETURNING clause was used in an expression context (which requires a return value).
- A misspelled routine name, or one that was never created — the most direct cause.
- No execute permission on the routine, per the official guidance.
- The wrong number of arguments supplied to the call, per the official guidance.
- A prepared statement referencing a routine that was dropped before the statement executed, per the official guidance — a specific timing scenario worth checking if the routine otherwise looks fine.
- An SPL routine with no
RETURNINGclause used inside an expression, per the official guidance — a routine must return a value to be usable that way, the same underlying restriction as -656 approached from the caller's side.
Solutions / Resolution
- Check the routine name's spelling and existence, per the official guidance:
SELECT procname, owner FROM sysprocedures WHERE procname = 'orders_status_check'; - Confirm execute permission on the routine, per the official guidance.
- Confirm the correct number of arguments and appropriate argument data types were supplied, per the official guidance.
- For a prepared statement, confirm the routine still exists at execution time, per the official guidance — re-prepare if it was dropped and recreated since the original prepare.
- Confirm the routine has a
RETURNINGclause if it's being used inside an expression, per the official guidance — a void routine can't be called that way.
Examples
Checking existence and permissions
SELECT procname, owner FROM sysprocedures WHERE procname = 'orders_status_check';
SELECT a.grantee, a.procauth FROM sysprocauth a, sysprocedures p
WHERE a.procid = p.procid AND p.procname = 'orders_status_check';
A void routine used in an expression
CREATE PROCEDURE log_event(p_msg VARCHAR(200))
-- no RETURNING clause
...
END PROCEDURE;
SELECT log_event('test') FROM systables WHERE tabid = 1;
-- -674: log_event has no RETURNING clause, so it can't be used in an expression
Diagnostic Checks
- Query
sysprocedures/sysprocauthfor the routine's existence and the caller's permission. - Recount the arguments and check their types against the routine's declared parameter list.
- Check for a
RETURNINGclause if the call is inside an expression rather than a standaloneEXECUTE PROCEDURE.
Related Errors / Related Topics
- -656 — "Routine is not declared to return values." The declaration-side version of this
error's fifth cause — a
RETURNstatement in a routine with noRETURNINGclause. - -673 — "Routine routine-name already exists in database." The mirror-image situation for creating a routine: one that already exists, rather than one that can't be resolved when called.
Five distinct possible causes share this one message — check existence, permission, argument
count/types, prepared-statement timing, and (for expression use) a RETURNING clause.