Using Stored Procedure result on INSERT?
Posted in 1998
FProse — — source: Informix-list mailing list archive (1991-1998)
I know it's possible to code a stored procedure that may be called as
an expression on a SELECT statement. For example:
CREATE PROCEDURE myproc(A,B) RETURNING SMALLINT...
let C = A + B;
return C
END PROCEDURE
Then you can :
SELECT col1, myproc(col1, col2) ...
Is it possible to do something similar on the INSERT?
INSERT into mytable(col1, col2, col3) values (23, 45, myproc(23, 45));
I recognize that if one were on the proper release (7.3) a triggered
Stored Procedure could be written if the desired results were as
simple as col3 = col1 + col2. But my requirements are a little more
dynamic that this and the function (SP) called would be determined by
the calling program.