Earlier versions of Adaptive Server did not allow you to define a default value for a SQLJ procedure parameter. With Adaptive Server 12.5.2, you can define a default value so that you can execute the SQLJ procedure without providing a parameter value.
This new capability of create procedure (SQLJ) mimics the existing behavior of create procedure.
create procedure [owner.]sql_procedure_name ( [ [ in | out | inout ] sql_parameter_name sql_datatype [( length )] | (precision[, scale]) ] [=default] [ , [ in | out | inout ] sql_parameter_name sql_datatype [( length )] | (precision[, scale]) ] [=default] ... ] ) ...
default
defines a default value for the procedure’s parameter. If a default is defined, you can execute the procedure without a parameter value. The default must be a constant. It can include the wildcard characters (%, _, [ ], and ^) if the procedure uses the parameter name with the keyword like.
The default can be NULL. The procedure definition can specify that some action be taken if the parameter value is NULL.
This procedure returns values that are always larger than 10:
create procedure my_max(a int = 10, b int = 10) language java parameter style java external name ’java.lang.Math.ma’ exec my_max (return status = 10) exec my_max 8 (return status = 10)
See also the examples for Transact-SQL create procedure.
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |