Table of Contents Previous Next


3 Stored Procedure Language : 3.2 SPL Programs : 3.2.7 Compilation Errors in Procedures and Functions

When the Advanced Server parsers compile a procedure or function, they confirm that both the CREATE statement and the program body (that portion of the program that follows the AS keyword) conforms to the grammar rules for SPL and SQL constructs. By default, the server will terminate the compilation process if a parser detects an error. Note that the parsers detect syntax errors in expressions, but not semantic errors (i.e. an expression referencing a non-existent column, table, or function, or a value of incorrect type).
spl.max_error_count instructs the server to stop parsing if it encounters the specified number of errors in SPL code, or when it encounters an error in SQL code. The default value of spl.max_error_count is 10; the maximum value is 1000. Setting spl.max_error_count to a value of 1 instructs the server to stop parsing when it encounters the first error in either SPL or SQL code.
You can use the SET command to specify a value for spl.max_error_count for your current session. The syntax is:
Where number_of_errors specifies the number of SPL errors that may occur before the server halts the compilation process. For example:
To save time when developing new code, or when importing existing code from another source, you may want to set the spl.max_error_count configuration parameter to a relatively high number of errors.
The following example adds a SELECT statement to the previous example. The error in the SELECT statement masks the other errors that follow:

3 Stored Procedure Language : 3.2 SPL Programs : 3.2.7 Compilation Errors in Procedures and Functions

Table of Contents Previous Next