Assign a specific routine name

Due to routine overloading, the database server might not be able to uniquely identify a routine by its name alone. When you register an overloaded UDR, you can assign a specific name to a particular signature of a routine. The specific name serves as a shorthand identifier that refers to a particular overloaded version of a routine.

A specific name can be up to 128 characters long and is unique in the database. Two routines in the same database cannot have the same specific name, even if they have different owners. To assign a unique name to an overloaded routine with a particular data type, use the SPECIFIC keyword when you create the routine. You specify the specific name, in addition to the routine name, in the CREATE PROCEDURE or CREATE FUNCTION statement.

You can use the specific name instead of the full routine signature in the following SQL statements:
  • ALTER FUNCTION, ALTER PROCEDURE, ALTER ROUTINE
  • DROP FUNCTION, DROP PROCEDURE, DROP ROUTINE
  • GRANT
  • REVOKE
  • UPDATE STATISTICS
For example, suppose you assign the specific name eq_udtype1 to the UDR that the following statement creates:
CREATE FUNCTION equal (arg1 udtype1, arg2 udtype1)
   RETURNING BOOLEAN
   SPECIFIC eq_udtype1
   EXTERNAL NAME
     '/usr/lib/udtype1/lib/libbtype1.so(udtype1_equal)'
   LANGUAGE C
You can then refer to the UDR with either the routine signature or the specific name. The following two GRANT statements are equivalent:
GRANT EXECUTE ON FUNCTION equal(udtype1, udtype1) to mary;
GRANT EXECUTE ON SPECIFIC FUNCTION eq_udtype1 to mary;