Parameter passing

The database server can pass opaque-type values to a UDR in either of the following ways:
  • Pass by value passes the actual value of the opaque data type to a UDR.
  • Pass by reference passes a pointer to the value of the opaque data type to a UDR.

By default, the database server passes all opaque types by reference. For the database server to pass an opaque data type by value, specify the PASSEDBYVALUE modifier in the CREATE OPAQUE TYPE statement. Only an opaque data type whose size is 4 bytes or smaller can be passed by value. However, the DataBlade® API data type mi_real, although only 4 bytes in length, is always passed by reference.

The following CREATE OPAQUE TYPE statement specifies that the two_bytes opaque data type be passed by value:
CREATE OPAQUE TYPE two_bytes (INTERNALLENGTH=2, ALIGNMENT=2,
   PASSEDBYVALUE);