Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   Other Syntax Segments > Return Clause >

Using the REFERENCES Clause to Point to a Simple Large Object

A user-defined function cannot return a BYTE or TEXT value (collectively called simple large objects) directly. A user-defined function can, however, use the REFERENCES keyword to return a descriptor that contains a pointer to a BYTE or TEXT object. The following example shows how to select a TEXT column within an SPL routine and then return the value:

CREATE FUNCTION sel_text()
   RETURNING REFERENCES text;
   DEFINE blob_var REFERENCES text;
   SELECT blob_col INTO blob_var 
      FROM blob_table WHERE key_col = 10;
   RETURN blob_var;
END FUNCTION;

In Extended Parallel Server, to emulate this example, you can use the CREATE PROCEDURE statement instead of the CREATE FUNCTION statement.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]