Example: String search over UDT

Assume that you are satisfied with the FINDSTRING functions from the BLOB string search, but now you have defined a distinct type BOAT with source type BLOB.

You also want FINDSTRING to operate on values having data type BOAT, so you create another FINDSTRING function. This function is sourced on the FINDSTRING which operates on BLOB values. Note the further overloading of FINDSTRING in this example:

     CREATE FUNCTION FINDSTRING (BOAT, VARCHAR(200)) 
       RETURNS INT
       SPECIFIC "slick_fboat" 
       SOURCE SPECIFIC FINDSTRING_BLOB

Note that this FINDSTRING function has a different signature from the FINDSTRING functions in Example: BLOB string search, so there is no problem overloading the name. Because you are using the SOURCE clause, you cannot use the EXTERNAL NAME clause or any of the related keywords specifying function attributes. These attributes are taken from the source function. Finally, observe that in identifying the source function you are using the specific function name explicitly provided in Example: BLOB string search. Because this is an unqualified reference, the schema in which this source function resides must be in the function path, or the reference will not be resolved.

Related reference
Example: BLOB string search