The DataServer allows you to call Oracle PL/SQL stored procedures, stored functions, and packages from within ABL procedures. Stored procedures and stored functions are self-contained groups of SQL statements that access the Oracle database. By executing a stored procedure or function, you can execute these statements or programs without having to enter their individual statements or code at each execution. Stored procedures and functions can return values or result codes. A package is a group of stored procedures, functions, and related program objects.
Note: This chapter uses the phrases RDBMS stored procedure and stored procedure interchangeably to refer to stored procedures and stored functions.
Enhancements to stored procedure and function techniques also allow you to extend your code in new ways and effectively employ more ABL features and functionality. For example, you can retrieve data from a foreign data source through a stored procedure and load this result set into a temp-table. Also, this technique is especially useful if you elect to further manage and manipulate your result set using ProDataSet capabilities.
Stored procedures can allow you to improve your DataServer's performance because they utilize the foreign data source's native capabilities. Stored procedures can be an efficient, productive approach to obtain data from a foreign data source or execute native business rules and procedures. In general, using stored procedures can help reduce network traffic, promote better performance, and improve response time because the server-side processing of the stored procedure can be accomplished without sustained communication with the client. Once this processing is completed, the server returns the data results to the requesting client.
The first task to effectively employ any stored procedure technique or approach is to determine what information you want to receive or process you want to run. Once you know your data requirements, you can proceed to define the stored procedure details.
Note: A complete discussion of creating and using native stored procedures is beyond the scope of this chapter. For this type of information, see your Oracle Server documentation.