Show TOC

alter function stringLocate this document in the navigation structure

Replaces an existing function string.

Syntax
alter function string {<replication_definition> |
      [<owner>.]table |
      <stored_procedure>}.<function>[;<function_string>]
      for {[<function_class>] function_class |
      [<database>] <data_server.database>} 
      [scan '<input_template>']
   [output
      {language '<lang_output_template>' | rpc 'execute <procedure> 
       [@<param_name>=]{<constant> |?<variable>!<mod>?}
       [, [@<param_name>=]{<constant> |?<variable>!<mod>?}]...' |
       writetext [use primary log | with log |
       no log] |
        none}]
Examples
Example 1
alters the rs_update customized function string for the authors table at the rdb1 target database in the NY_DS data server:
alter function string authors.rs_update
        for database NY_DS.rdb1
        output language
        'update authors set
                au_lname = ?au_lname!param?,
                au_fname = ?au_fname!param?,
                phone = ?phone!param?,
                address = ?address!param?,
                city = ?city!param?,
                state = ?state!param?,
                zip = ?zip!param?,
                contract = ?contract!param?
Usage
  • alter function string is the same as create function string, except that it executes drop function string first. The function string is dropped and re-created in a single transaction to prevent errors that would result from missing function strings.

  • Alter function strings for functions with class scope at the primary site for the function string class. See create function string class for more information about the primary site for a function-string class.

  • Alter function strings for functions with replication definition scope, including user-defined functions, at the site where the replication definition was created. Each replication definition has its own set of function strings.

  • Execute alter function string for target-scope function strings at the Replication Server that controls the target database, which is either the standby or replicate database.
  • For rs_select, rs_select_with_lock, rs_datarow_for_writetext, rs_get_textptr, rs_textptr_init, and rs_writetext function strings, Replication Server uses the <function_string> name to determine which string to alter. If a <function_string> name was provided when the function string was created, you must specify it with alter function string so that the function string to be altered can be found.

  • See create function string for more information about various parameter descriptions of keywords and options you can use with alter function sting.

  • To restore the default function string for a function, omit the output clause.

Permissions

alter function string requires “create object” permission.