Re: Stored Procedure Qn
Posted in 1996
Re-raise the exception in the exception block:
CREATE PROCEDURE xxx(...)
-- DEFINE ...
ON EXCEPTION SET esql, eisam, estr; call log_the_error_function;
RAISE EXCEPTION esql, eisam, estr;
END EXCEPTION
-- code to check some values and insert some rows;
END PROCEDURE ;
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
}From: gururaj@PROBLEM_WITH_INEWS_GATEWAY_FILE.informix.com (Gururaj)
}Date: 28 Dec 1995 14:54:52 GMT
}X-Informix-List-Id: <news.19930>
}
} I am working on INFORMIX 5.03 Online version on HP-UX.
}I am encountering the following problem when executing a stored
}procedure from a ESQL/C program.
}
}The stored proc is like this:
}
}-------------------------------------------------
}CREATE PROCEDURE xxx;
}ON EXCEPTION SET esql, eisam, estr;
} call log_the_error_function;
}END EXCEPTION
}
} -- code to check some values and insert some rows;
}
}END PROCEDURE ;
}
}-------------------------------------------------
}My esql/c program:
} executes the stored proc xxx after which it checks for the status
}value in sqlca.sqlcode.
}-------------------------------------------------
}
}What is happening is the stored procedure is
}returning error -271 and ISAM error 143 for deadlock detection
}which gets logged by the log_the_error_function
}but
}my esql/c program is not able to capture this error.
}Is sqlca.sqlcode not set after EXECUTE PROCEDURE call?
}If so what should I look for to capture this error?
}
}Any help in this regard will be appreciated.
}
}Thanks,
}Gururaj
}-----------------------------------------------------------
}Gururaj P Ramarao e-mail: gururaj@gtetel.com
}1924I, Johnson Ferry Road, Phone : (404)648-7224 W
}Atlanta GA 30319 (770)458-3037 H
}-----------------------------------------------------------