Subject | nested procedures |
---|---|
Author | kisa933 |
Post date | 2002-01-31T16:01:41Z |
Hello!
I have a little problem with nesting procedures. I try to exlpain the
situation shortly.
I have four stored procedures PROC_A, PROC_B, PROC_C and PROC_D
implementing this way:
In PROC_A there is a SELECT ... FROM PROC_B statement, in PROC_B there
is a SELECT ... FROM PROC_C statement, in PROC_C there is a SELECT ...
FROM PROC_D statement and finally PROC_D looks something like this:
CREATE PROCEDURE PROC_D(
VAR_INPUT SMALLINT)
RETURNS (
VAR_OUTPUT1 INTEGER)
AS
DECLARE VARIABLE VAR_LOCAL INTEGER;
BEGIN
...
IF VAR_LOCAL = SOMETHING THEN
SELECT VALUE_NUMERIC
FROM PROC_A(:VAR_OUTPUT)
INTO :VAR_OUTPUT1;
ELSE
VAR_OUTPUT = 0;
SUSPEND;
END
Mostly the SELECT * FROM PROC_A statement works fine, but in some
cases it raises an exception of "Arithmetic owerflow or division by
zero occured. arithmetic exception, numeric owerflow, or string
truncation."
I'm sure it isn't an infinite loop, because a tried to debug it and
executing it procedure by procedure it works after some step.
Could anybody help me what would cause the error?
Thanks in advance!
Sandor Kiss
I have a little problem with nesting procedures. I try to exlpain the
situation shortly.
I have four stored procedures PROC_A, PROC_B, PROC_C and PROC_D
implementing this way:
In PROC_A there is a SELECT ... FROM PROC_B statement, in PROC_B there
is a SELECT ... FROM PROC_C statement, in PROC_C there is a SELECT ...
FROM PROC_D statement and finally PROC_D looks something like this:
CREATE PROCEDURE PROC_D(
VAR_INPUT SMALLINT)
RETURNS (
VAR_OUTPUT1 INTEGER)
AS
DECLARE VARIABLE VAR_LOCAL INTEGER;
BEGIN
...
IF VAR_LOCAL = SOMETHING THEN
SELECT VALUE_NUMERIC
FROM PROC_A(:VAR_OUTPUT)
INTO :VAR_OUTPUT1;
ELSE
VAR_OUTPUT = 0;
SUSPEND;
END
Mostly the SELECT * FROM PROC_A statement works fine, but in some
cases it raises an exception of "Arithmetic owerflow or division by
zero occured. arithmetic exception, numeric owerflow, or string
truncation."
I'm sure it isn't an infinite loop, because a tried to debug it and
executing it procedure by procedure it works after some step.
Could anybody help me what would cause the error?
Thanks in advance!
Sandor Kiss