Procedure

The Procedure category is located in the Root > Script > Objects category, and can contain the following items that define how procedures are modeled for your DBMS.

Item

Description

[Common items]

The following common object items may be defined for procedures:

  • AfterCreate, AfterDrop, AfterModify

  • BeforeCreate, BeforeDrop, BeforeModify

  • Create, Drop

  • Enable, EnableOwner, EnableSynonym

  • Maxlen

  • ModifiableAttributes

  • Permission

  • ReversedQueries, ReversedStatements

  • SqlAttrQuery, SqlListQuery, SqlPermQuery

For a description of each of these common items, see Common object items.

CreateFunc

Specifies the statement for creating a function.

Example (SQL Anywhere 10):

create function [%QUALIFIER%]%FUNC%[%PROCPRMS%?([%PROCPRMS%])] %TRGDEFN%

CustomFunc

Specifies the statement for creating a user-defined function, a form of procedure that returns a value to the calling environment for use in queries and other SQL statements.

Example (SQL Anywhere 10):

create function [%QUALIFIER%]%FUNC% (<arg> <type>) RETURNS <type>
begin
end

CustomProc

Specifies the statement for creating a stored procedure.

Example (SQL Anywhere 10):

create procedure [%QUALIFIER%]%PROC% (IN <arg> <type>)
begin
end

DropFunc

Specifies the statement for dropping a function.

Example (SQL Anywhere 10):

if exists(select 1 from sys.sysprocedure where proc_name = %.q:FUNC%[ and user_name(creator) = %.q:OWNER%]) then
 drop function [%QUALIFIER%]%FUNC%
end if

EnableFunc

Specifies whether functions are allowed. Functions are forms of procedure that return a value to the calling environment for use in queries and other SQL statements.

Function Comment

Specifies a statement for adding a function comment.

ImplementationType

Specifies a list of available procedure template types.

MaxFuncLen

Specifies the maximum length of the name of a function.

Procedure Comment

Specifies a statement for adding a procedure comment.