Configuring any User Defined Function

To Configure any User defined function:

  1. The information to be inserted into the tables rti_function, rti_func_arg_map, and rti_func_data_type.
  2. To configure the above Created Function to appear in the Select Function drop-down, execute the following Scripts in the Config Schema.

    The values should be added to the following tables according to the format shown below:

    insert into RTI_FUNCTION (N_FUNC_ID, V_RETURN_TYPE, V_FUNC_CODE, V_FUNC_NAME, 
    V_DESC, V_NOTES, V_FUNC_TYPE, V_FUNC_STR, V_MAX_PARAM) 
    values(value1,value2,value3….)
    
    where,
    • N_FUNC_ID is a unique value given to the function.
    • V_RETURN_TYPE is the return type of the function.
    • V_FUNC_CODE is the function code.
    • V_FUNC_NAME is the name of the function.
    • V_DESC is the description provided for the function.
    • V_NOTES is the information provided regarding the function.
    • V_FUNC_TYPE is the return type of the function.
    • V_FUNC_STR is the function.
    • V_MAX_PARAM is the number of maximum parameters allowed for the function.

    Example,

    insert into RTI_FUNCTION (N_FUNC_ID, V_RETURN_TYPE, V_FUNC_CODE, V_FUNC_NAME, 
    V_DESC, V_NOTES, V_FUNC_TYPE, V_FUNC_STR, V_MAX_PARAM) 
    values (30, 'VARCHAR2(200)', 'GETLASTCHARS', 'Get Last Characters ', 'Gets 
    the Last Characters.', null, 'F', 'GETLASTCHARS(@1@,@2@,@3)', 3);
    
    insert into RTI_FUNC_ARG_MAP (N_MAP_ID, N_FUNC_ID, V_ARG_DESC, 
    V_ARG_DATA_TYPE, N_ARG_NUM)
    values(value1,value2,value3…..)
    where,
    • N_MAP_ID is a mapping value given to the function.
    • N_FUNC_ID is a unique value given to the function.
    • V_ARG_DESC is the description provided for the argument.
    • V_ARG_DATA_TYPE is the datatype of the argument of the function.
    • N_ARG_NUM is the sequential number given to the argument.

    Example,

    insert into RTI_FUNC_ARG_MAP (N_MAP_ID, N_FUNC_ID, V_ARG_DESC, 
    V_ARG_DATA_TYPE, N_ARG_NUM) 
    values (40, 30, 'Char Value to be evaluated', 'char', 1); 
    insert into RTI_FUNC_ARG_MAP (N_MAP_ID, N_FUNC_ID, V_ARG_DESC, 
    V_ARG_DATA_TYPE, N_ARG_NUM) 
    values (41, 30, 'Number of places', 'char', 2);
    insert into RTI_FUNC_ARG_MAP (N_MAP_ID, N_FUNC_ID, V_ARG_DESC, 
    V_ARG_DATA_TYPE, N_ARG_NUM) 
    values (42, 30, '..............', 'char', 3);
    
    insert into RTI_FUNC_DATA_TYPE (N_MAP_ID, N_FUNC_ID, V_DATA_TYPE) 
    values (70, 30, 'CHAR');
    values(value1,value2,value3….)
    where,
    • N_MAP_ID is a mapping value given to the function.
    • N_FUNC_ID is a unique value given to the function.
    • V_DATA_TYPE is the datatype of the function.

    Example,

    insert into RTI_FUNC_DATA_TYPE (N_MAP_ID, N_FUNC_ID, V_DATA_TYPE) 
    values (70, 30, 'CHAR'); 
    insert into RTI_FUNC_DATA_TYPE (N_MAP_ID, N_FUNC_ID, V_DATA_TYPE) 
    values (71, 30, 'VARCHAR');
    insert into RTI_FUNC_DATA_TYPE (N_MAP_ID, N_FUNC_ID, V_DATA_TYPE) 
    values (72, 30, 'VARCHAR');