15.00 - UDF .so and .dll Linkage Information - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

prodname
Teradata Database
vrm_release
15.00
category
Programming Reference
featnum
B035-1184-015K

UDF .so and .dll Linkage Information

There is only one UDF .so or .dll file per application category per database per node.

 

IF the value for Application Category is …

THEN the format of the .so or .dll file is …

> 0

  • libudf_dbid_librevno_AppCat.so
  • or

  • libudf_dbid_librevno_AppCat.dll
  • = 0

  • libudf_dbid_librevno.so
  • or

  • libudf_dbid_librevno.dll
  • Whenever you create, replace, or drop a UDF, the UDF .so or .dll file for that database has to be relinked with all the other UDF object files and then redistributed to all the nodes.

    The following example shows the output of a UDF creation on a Linux system. The .so file, libudf_03ee_n.so, increments each time a UDF is created, replaced, or dropped. This CREATE FUNCTION operation was the eighth such UDF‑related operation in the current database, so the .so file is named libudf_03ee_8.so.

    The 5607 Warning message is normal.

        CREATE FUNCTION another(
         strexp VARCHAR(512), 
         n1     INTEGER)
        RETURNS VARCHAR(512) 
        LANGUAGE C 
        NO SQL 
        PARAMETER STYLE SQL 
        EXTERNAL NAME 'SS!another!another.c!F!another';
        
         *** Function has been created. 
         *** Warning: 5607 Check output for possible warnings encountered in compiling XSP/UDF.
         *** Total elapsed time was 5 seconds.
        
        Check output for possible compilation warnings.
        ------------------------------------------------------------
         /usr/bin/cc  -Xc -I /tpasw/etc -c -o another.o another.c
        Teradata High Performance C Compiler R3.0c
        (c) Copyright 1994-98, Teradata Corporation
        (c) Copyright 1987-98, MetaWare Incorporated
         /usr/bin/cc  -Xc -I /tpasw/etc -c -o pre_another.o pre_another.c
        Teradata High Performance C Compiler R3.0c
        (c) Copyright 1994-98, Teradata Corporation
        (c) Copyright 1987-98, MetaWare Incorporated
         /usr/bin/cc -G  -Xc -I /tpasw/etc -o libudf_03ee_8.so 
        another.o pre_another.o pre_really_long_function_name.o
        long_name.o pre_udf_scalar_substr.o substr.o pre_Find_Text.o
        pattern.o pre_char2hexint.o char2hexint.o   -ludf -lmw -lm

    Similarly, the following REPLACE FUNCTION was the tenth such UDF‑related operation in the current database, so the .so file is named libudf_03ee_10.so.

    Again, the 5607 Warning message is normal.

        REPLACE FUNCTION another (
         strexp VARCHAR(512), 
         n2     INTEGER) 
        RETURNS VARCHAR(512) 
        LANGUAGE C 
        NO SQL 
        PARAMETER STYLE SQL 
        EXTERNAL NAME 'SS!another!another.c!F!another';
        
         *** Function has been created. 
         *** Warning: 5607 Check output for possible warnings encountered in compiling XSP/UDF.
         *** Total elapsed time was 1 second.
        
        Check output for possible compilation warnings.
        ------------------------------------------------------------
         /usr/bin/cc  -Xc -I /tpasw/etc -c -o another.o another.c
        Teradata High Performance C Compiler R3.0c
        (c) Copyright 1994-98, Teradata Corporation
        (c) Copyright 1987-98, MetaWare Incorporated
         /usr/bin/cc  -Xc -I /tpasw/etc -c -o pre_another.o pre_another.c
        Teradata High Performance C Compiler R3.0c
        (c) Copyright 1994-98, Teradata Corporation
        (c) Copyright 1987-98, MetaWare Incorporated
         /usr/bin/cc -G  -Xc -I /tpasw/etc -o libudf_03ee_10.so 
        another.o pre_another.o pre_Find_Text.o pattern.o
        pre_udf_scalar_substr.o substr.o
        pre_really_long_function_name.o long_name.o pre_char2hexint.o
        char2hexint.o   -ludf -lmw -lm