CHAPTER 6 Using Procedures and Batches
269
This section describes how to use the external library calls in procedures.
Warning!
External libraries can corrupt your database.
External libraries called from procedures share the memory of the server. If you
call a DLL from a procedure and the DLL contains memory-handling errors,
you can crash the server or corrupt your database. Ensure that your libraries are
thoroughly tested before deploying them on production databases.
Creating procedures and functions with external calls
This section presents some examples of procedures and functions with external
calls.
For a full description of the CREATE PROCEDURE statement syntax, see
“CREATE PROCEDURE statement” in Adaptive Server IQ Reference
Manual.
For a full description of the CREATE FUNCTION statement syntax for
external calls, see “CREATE FUNCTION statement” in Adaptive Server IQ
Reference Manual.
Note
You must have DBA permissions in order to create external procedures
or functions. This requirement is more strict than the RESOURCE permissions
required for creating other procedures or functions.
Syntax
A procedure that calls a function function_name in DLL library.dll can be
created as follows:
CREATE PROCEDURE dll_proc ( parameter-list )
EXTERNAL NAME ’[email protected]’
Such a procedure is called an external stored procedure. If you call an
external DLL from a procedure, the procedure cannot carry out any other tasks;
it just forms a wrapper around the DLL.
An analogous CREATE FUNCTION statement is as follows:
CREATE FUNCTION dll_func ( parameter-list )
RETURNS data-type
EXTERNAL NAME ’[email protected]’
Summary of Contents for Adaptive Server IQ 12.4.2
Page 1: ...Administration and Performance Guide Adaptive Server IQ 12 4 2 ...
Page 16: ...xvi ...
Page 20: ...Related documents xx ...
Page 40: ...Compatibility with earlier versions 20 ...
Page 118: ...Troubleshooting startup shutdown and connections 98 ...
Page 248: ...Importing data by replication 228 ...
Page 306: ...Integrity rules in the system tables 286 ...
Page 334: ...Cursors in transactions 314 ...
Page 396: ...Users and permissions in the system tables 376 ...
Page 438: ...Determining your data backup and recovery strategy 418 ...
Page 484: ...Network performance 464 ...
Page 500: ...System utilities to monitor CPU use 480 ...
Page 514: ...Characteristics of Open Client and jConnect connections 494 ...
Page 536: ...Index 516 ...