User-Defined Functions Compliance with Sybase IQ databases

Developing user-defined functions to work with Sybase IQ databases.

Seamless Execution

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

UDFs run under the cover of Sybase IQ, so do not write console messages. Present any feedback to the user through predefined exception messages.

UDFs should manage memory and temporary results as defined by the Sybase IQ UDF API.

Sybase IQ manages disk I/O in a reliable manner to guarantee data availability and integrity. UDFs should generally not write to or read from the file system.

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 additional details on setting UDFs to run in parallel, see Aggregate UDF calling patterns.

Internationalization

Sybase IQ has been internationalized, so that it can be sold in different countries around the world, to users who speak many different languages. Error messages have been extracted from the code and put into external files. This lets you 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 will 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.

Sybase IQ has also been localized to a few non-English foreign languages. To support localization to the same languages as Sybase IQ supports, Sybase recommends that you internationalize UDFs allowing them to be localized at a later date, by an independent organization.

For details about international language support in Sybase IQ, see the Sybase IQ System Administration Guide, > International Languages and Character Sets.

See also Debugging Using Cross-Character-Set Mapsat www.Sybase.com. This paper discusses how to 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 Sybase IQ. The Sybase IQ 15.x server runs on 64-bit architectures, and is supported under several platforms of the MS Windows (64-bit) family of operating systems. It is also supported on various types and versions of UNIX (64-bit), including Solaris, HP-UX, AIX, and Linux.