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