SQL statements

The SQL statements for the following tasks handle the database objects that the listpos() function requires:
  1. Register the user-defined function named listpos():
    CREATE FUNCTION listpos() 
    RETURNS INTEGER 
    EXTERNAL NAME '$USERFUNCDIR/sql_listpos.udr' 
    LANGUAGE C;
  2. Create a table named tab2:
    CREATE TABLE tab2 (a INT);
    INSERT INTO tab2 VALUES (1);
  3. Add the trace class that the DPRINTF statements in listpos() use:
    INSERT INTO informix.systraceclasses(name)
       VALUES ('trace_class');
  4. Run the listpos() UDR:
    SELECT listpos() FROM tab2;
  5. Clean up the resources:
    DROP FUNCTION listpos;
    DROP TABLE tab2;