Introduction To User-Defined Functions; Creating User-Defined Functions - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

Introduction to user-defined functions

Creating user-defined functions

Employee ID
Salary
243
72995.000
247
48023.690
To execute a CALL of a procedure that returns a result set, DBISQL opens a
cursor.
The cursor is left open after the CALL in case a second result set is returned.
The DBISQL statistics window displays the plan of the SELECT query in the
procedure and then displays the line:
Procedure is executing. Use RESUME to continue.
You need to execute the
RESUME
from the DBISQL Command window before you can alter or drop the
procedure.
For more information about using cursors in procedures, see "Using cursors
in procedures" on page 251
User-defined functions are a class of procedures that return a single value to the
calling environment. This section introduces creating, using, and dropping
user-defined functions.
User-defined functions are created using the
You must have RESOURCE authority in order to create a user-defined
function.
The following simple example creates a function that concatenates two strings,
together with a space, to form a full name from a first name and a last name.
You can create the example function
database from DBISQL as user ID DBA, using password SQL, and typing the
statement in the command window.
CHAPTER 6
Using Procedures and Batches
statement or the DBISQL
CREATE FUNCTION
by connecting to the sample
fullname
command
CLEAR
statement.
235

Advertisement

Table of Contents
loading

Table of Contents