Previous Topic Next topic Print topic


ALTER FUNCTION (SQL)

The ALTER FUNCTION (SQL) statement changes the description of a user-defined SQL scalar function at the current server.

Invocation

This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared only if DYNAMICRULES run behavior is implicitly or explicitly specified.

Authorization

The privilege set defined below must include at least one of the following:

  • Ownership of the function
  • The ALTERIN privilege on the schema
  • SYSADM or SYSCTRL authority

The authorization ID that matches the schema name implicitly has the ALTERIN privilege on the schema.

If the statement is embedded in an application program, the privilege set is the privileges that are held by the authorization ID of the owner of the plan or package.

If the statement is dynamically prepared, the privilege set is the privileges that are held by the authorization IDs of the process. The specified function name can include a schema name (a qualifier). However, if the schema name is not the same as one of these authorization IDs, one of the following conditions must be met:

  • The privilege set includes SYSADM or SYSCTRL authority.
  • An authorization ID of the process has the ALTERIN privilege on the schema.

Syntax

Bold text indicates clauses or options that are supported only syntactically.

ALTER {FUNCTION function-name [(parameter-type[,...])] | 
    SPECIFIC FUNCTION specific-name}
    option-list

parameter-type

{data-type [AS LOCATOR] | TABLE LIKE table-name AS LOCATOR}

data-type

{built-in-type | distinct-type-name}

built-in-type

[SMALLINT]
[INTEGER | INT]
[DECIMAL | DEC | NUMERIC} [(5,0) | (integer [,integer])]
[FLOAT [(53) | (integer)] | REAL [PRECISION] | DOUBLE}]
[{{CHARACTER | CHAR} [(1) | (integer)] | {CHARACTER | CHAR} VARYING (integer) | VARCHAR (integer) } 
    [FOR {SBCS | MIXED | BIT} DATA] [CCSID {EBCDIC | ASCII | UNICODE}] |
    {{CHARACTER | CHAR} LARGE OBJECT | CLOB} [(1M) | (integer [K | M | G])] } 
    [FOR {SBCS | MIXED} DATA] [CCSID {EBCDIC | ASCII | UNICODE}] }]
[{GRAPHIC [(1) | (integer)] | VARGRAPHIC (integer) | DBCLOB [(1M) | (integer [K | M | G])]} 
    [CCSID {ASCII | EBCDIC | UNICODE}]]
[{BINARY LARGE OBJECT | BLOB} [(1M) | (integer [K | M | G])]]
[DATE | TIME | TIMESTAMP]
[ROWID]

option-list

LANGUAGE SQL 
    [DETERMINISTIC | NOT DETERMINISTIC]
    [EXTERNAL ACTION | NO EXTERNAL ACTION]
    [CONTAINS SQL | READS SQL DATA]
    [STATIC DISPATCH CALLED ON NULL INPUT]
Previous Topic Next topic Print topic