Running the Sample Table UDF in udf_rg_1.cxx

The sample udf_rg_1 is included in a precompiled dynamic library called libv4apiex (extension is platform-dependent). Its implementation is in the samples directory in udf_rg_1.cxx.

  1. Put the library libv4apiex in a directory that can be read by the server.
  2. To declare the table UDF to the server, issue:
    CREATE PROCEDURE udf_rg_1( IN num INT )
    RESULT( c1 INT )
    EXTERNAL NAME ‘udf_rg_1@libv4apiex’
  3. Select rows from the table UDF:
    SELECT * FROM udf_rg_1( 5 );