Set up a new external C or C++ aggregate function on a Sybase IQ server.
Prerequisites
- Authenticate with Sybase IQ using an account that has DBA authority.
- (Optional) Copy the library that contains the external function to a location accessible to the Sybase IQ server. (You can create the function if the library is not accessible to Sybase IQ, but Sybase IQ cannot execute the function.)
Task
For detailed information on scalar and aggregate functions, see User-Defined Functions in the Sybase IQ documentation set.
- In the Perspective Resources view, select the resource and select .
- In the Administration Console, expand .
- Select Functions, click the drop-down arrow that appears to the right, and select New.
- In the Create Function wizard, select the Sybase IQ server on which the function is to reside.
- Select a user or group to own the function.
- Enter a name for the function.
- Select the C/C++ scalar or aggregate function type.
- Check Use SQL template to insert a hardcoded SQL template and skip the wizard pages for defining the return variable, function attributes, and clauses.
- If you chose not to use the SQL template, define a return variable on the Specify Return Type page.
- If you chose not to use the SQL template, configure the attributes of the function, including the names of its shared library file and descriptor function, on the Function Attributes page.
- If you chose not to use the SQL template, configure clauses that control windows on the Function Clauses page.
- On the SQL page, edit the code provided by the wizard.
- Define input parameters: name, type, and default value.
- If you chose to use the SQL template, replace the placeholder external name at the end of the query with a real name of the form functionDescriptorName@libraryName.
- Make any other changes needed to complete your function.
- (Optional) Enter a comment describing the function.
Comments can include both HTML and Javadoc tags, so you can incorporate them into your generated database documentation.
- Click Finish to save the function.
The new function appears in the Functions list in the right pane of the Administration Console.