User-Defined Functions Compliance with SAP Sybase IQ Databases

Develop user-defined functions to work with SAP Sybase IQ databases.

Seamless Execution

UDFs must run seamlessly within the database container. Although SAP Sybase IQ is a complex product consisting of many files, the main user interaction is through a server process (iqsrv16.0), using industry-standard Structured Query Language (SQL). Execution of UDFs should be accomplished entirely through SQL commands; the user does not need to understand the underlying implementation method to use the UDFs.

The EXTFN_V3_API and EXTFN_V4_API provide callback functions enabling the UDF to write to the message file (.iqmsg).

UDFs should manage memory and temporary results as defined by the EXTFN_V3_API and EXTFN_V4_API.

SAP Sybase IQ is a multiuser application. Many users can simultaneously execute the same UDF. Certain OLAP queries cause a UDF to be executed multiple times within the same query, sometimes in parallel. For details on setting UDFs to run in parallel, see Aggregate UDF calling patterns.

Internationalization

SAP Sybase IQ has been internationalized for global use. Error messages are in external files, which allows you to localize error messages to new languages without having to make extensive code changes.

To support multiple languages, UDFs should also be internationalized. In general, most UDFs operate on numeric data. In some cases, a UDF may accept string keywords as one or more of the parameters. Place these keywords in external files, in addition to any exception text and log messages used by the UDF.

SAP Sybase IQSAP Sybase IQ has also been localized for a few non-English languages. To support localization to the same languages that SAP Sybase IQ supports, internationalize UDFs so that an independent organization can localize them at a later date.

For details about international language support in SAP Sybase IQ, see International Languages and Character Sets in Administration: Globalization .

See also Debugging Using Cross-Character-Set Maps at www.Sybase.com. This paper discusses how to debug with multi byte data, as opposed to input keywords, exception messages, and log entries.

Platform Differences

Develop UDFs to run on a variety of platforms supported by SAP Sybase IQ. The SAP Sybase IQ 16.0 server runs on 64-bit architectures, and is supported under several platforms of the MS Windows (64-bit) family of operating systems. SAP Sybase IQ is also supported on versions of UNIX (64-bit), including Solaris, HP-UX, AIX, and Linux.