Adding or Modifying a Routine Modifier

Use this segment in the ALTER FUNCTION, ALTER PROCEDURE, or ALTER ROUTINE statement to add or modify values for routine modifiers of a UDR.

Read syntax diagramSkip visual syntax diagram
Adding or Modifying a Routine Modifier

        (1)   (2)                                      
|--+-+-----------+------------------+-+------------+------------|
   | |           '-+-----+--VARIANT-' |            |   
   | |             '-NOT-'            |            |   
   | '-NEGATOR =neg_func--------------'            |   
   |                                               |   
   |  (3)                                          |   
   '-----+-CLASS =class_name---------------------+-'   
         +-ITERATOR------------------------------+     
         +-PARALLELIZABLE------------------------+     
         |  (1)                                  |     
         '-------+---HANDLESNULLS--------------+-'     
                 +-INTERNAL--------------------+       
                 |                  .- 0 --.   |       
                 +-+-PERCALL_COST = +-cost-+-+-+       
                 | '-COSTFUNC =cost_func-----' |       
                 +-+-SELFUNC =sel_func-----+---+       
                 | '-SELCONST =selectivity-'   |       
                 '-STACK =stack_size-----------'       

Notes:
  1. C language
  2. Stored Procedure Language
  3. External routines only
Element Description Restrictions Syntax
class_name Virtual processor (VP) class in which to run the external routine Any C UDR must run in the CPU VP or in a user-defined VP class Quoted String.
cost CPU use cost for each invocation of a C-language UDR. Default is 0. Integer; 1 ≤ cost ≤ 231-1 (highest cost). Literal Number
cost_func Name of a companion user-defined cost function to run Must have same owner as the UDR. Execute privilege is needed to run. Identifier
neg_func Negator function that can be invoked instead of the UDR Must have same owner as the UDR. Execute privilege is needed to run. Identifier
sel_func Name of a companion user-defined selectivity function to invoke Must have same owner as the UDR. Execute privilege is needed to run. Identifier
selectivity CPU use cost for each invocation of a C-language UDR. Default is 0. See Concept of Selectivity. Literal Number
stack_size Size (in bytes) of stack of the thread that runs the C-language UDR Must be a positive integer Literal Number

You can add these modifiers in any order. If you list the same modifier more than once, the last setting overrides any previous values.


Copyright© 2021 HCL Technologies Limited