Product Documentation

FairCom Java & .NET Stored Procedures

Previous Topic

Next Topic

Introduction

Scalar functions are an integral part of the support provided by FairCom DB SQL for query expressions. FairCom DB SQL provides several built-in scalar functions that transform data in different ways. However, at times there is a requirement for custom-transformation of data—a transformation that is not provided by the provided functions. This problem is solved by the concept of a user-defined scalar function (UDF)—a scalar function that is defined by the user. FairCom DB SQL UDFs allow the user to define their own functions to transform data in some custom manner.

User-Defined Scalar Functions are an extension to the existing built-in scalar functions and return a single value each time one is invoked. These functions can be used in queries in the same way that system defined scalar functions are used.

The user defines functions by creating Java Stored Functions, modules written in Java that are similar to the ones written for stored procedures and triggers. The Java code snippet contained in the User-Defined Scalar Function definition is processed by FairCom DB SQL into a Java class definition and stored in the database in text and compiled form. User-Defined Scalar Functions can be created, executed and dropped using ISQL, ODBC and JDBC.

TOCIndex