EasyManua.ls Logo

Sybase Adaptive Server Anywhere - Miscellaneous Functions

Sybase Adaptive Server Anywhere
1182 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 8 SQL Functions
307
You can implement your own functions in SQL using the "CREATE
FUNCTION statement" on page 445. The RETURN statement inside the
CREATE FUNCTION statement determines the data type of the function.
Once a SQL user-defined function is created, it can be used anywhere a
built-in function of the same data type is used.
$ For more information on creating SQL functions, see "Using
Procedures, Triggers, and Batches" on page 435 of the book ASA User’s
Guide.
Although SQL functions are useful, Java classes provide a more powerful
and flexible way of implementing user-defined functions, with the additional
advantage that they can be moved from the database server to a client
application if desired.
Any class method of an installed Java class can be used as a user-defined
function anywhere a built-in function of the same data type is used.
Instance methods are tied to particular instances of a class, and so have
different behavior from standard user-defined functions.
$ For more information on creating Java classes, and on class methods,
see "A Java seminar" on page 523 of the book ASA User’s Guide.
Miscellaneous functions
Miscellaneous functions perform operations on arithmetic, string or date/time
expressions, including the return values of other functions.
The following miscellaneous functions are available:
"ARGN function" on page 314
"COALESCE function" on page 320
"ESTIMATE function" on page 334
"EXPERIENCE_ESTIMATE function" on page 338
"ESTIMATE_SOURCE function" on page 334
"IFNULL function" on page 340
"INDEX_ESTIMATE function" on page 341
"ISNULL function" on page 342
"NULLIF function" on page 353
"NUMBER function" on page 354
User-defined
functions in SQL
User-defined
functions in Java
List of functions

Table of Contents

Related product manuals