Using IQ UTILITIES to Create Your Own Stored Procedures

The system stored procedures provided in Sybase IQ are implemented in SQL, using the methods described in the rest of this chapter.

You must use the local temporary table and IQ UTILITIES statement in exactly the same way as system stored procedures:

Warning!   Violating these rules can cause serious problems for your IQ server or database.

All SQL code for procedures is encrypted and compiled into the shared library libiqscripts15_r.so file on Unix and iqscripts15.dll file on Windows.

You can view the stored procedures code by using Sybase Central or by entering sp_helptext 'owner.procname' in Interactive SQL.

The syntax for IQ UTILITIES is:
IQ UTILITIES MAIN INTO local-temp-table-name arguments

The IQ UTILITIES command is only documented in Reference: Statements and Options due to strict requirements for its use and the risk to system operations if it is used incorrectly.

You may want to create your own variants of some of these procedures. For example:

  1. Create a procedure that calls a system stored procedure.
  2. Create a procedure that is independent of the system stored procedures but performs a similar function.
  3. Create a procedure that uses the same structure as the system stored procedures but provides additional functionality. For example, you might want to display procedure results in graphical form in a front-end tool or browser rather than as text.
  4. If you choose the second or third option, you need to understand the IQ UTILITIES statement and the strict requirements for using it.