Specifying INOUT Parameters for a User-Defined Routine
UDRs that are written in the SPL, C, or Java™ languages can also support INOUT parameters. When the UDR is invoked, a value for each INOUT parameter is passed by reference as an argument to the UDR.
- Serial types (BIGSERIAL, SERIAL, and SERIAL8)
- Simple large object types (BYTE and TEXT).
CREATE PROCEDURE CALC ( INOUT param1 float ) EXTERNAL NAME "$ONEDB_HOME/etc/myudr.so(calc)" LANGUAGE C;
An SPL routine can invoke other UDRs that have OUT or INOUT parameters, if those UDRs are written in the SPL or C language. An SPL routine cannot, however, invoke a Java UDR whose arguments include OUT or INOUT parameters.
- SPL routines can invoke C UDRs that have ROW arguments that are IN parameters, but cannot invoke C UDRs that have ROW arguments that are OUT or INOUT parameters.
- SPL routines can invoke SPL UDRs that have ROW arguments of any parameter type, including IN, OUT, and INOUT.
You can assign INOUT parameters to statement-local variables (SLVs), which the section Statement-Local Variable Expressions describes.