The createProcedure Change Type defines the definition for a stored procedure. This Change Type is better to use for creating procedures than the raw SQL command because it will not attempt to strip comments or break up lines.

Often times it is best to use the CREATE OR REPLACE syntax along with setting runOnChange='true' on the enclosing changeset tag. That way if you need to make a change to your procedure, you can change your existing code rather than creating a new REPLACE PROCEDURE call. The advantage to this approach is that it keeps your changelog smaller and allows you to more easily see what has changed in your procedure code through your source control system's diff command.

Available attributes

Name Description Required for Supports

Name of the catalog

dbms Specifies which database types the change must be applied to. Valid database type names are listed on the supported databases page. Separate multiple databases with commas. Specify that a change does not apply to a database type by prefixing it with !. The keywords all and none are also available. all
encoding The encoding used in the file defined in the path attribute all
path The file containing the procedure text. Either this attribute or a nested procedure text is required. all all
procedureText The SQL creating the procedure. You need to define either this attribute or the path attribute. The procedureTextattribute is not supported in the XML format; however, you can specify the procedure SQL within <createProcedure></createProcedure> tags. See the XML example. all all
procedureName The name of the procedure. It is required if replaceIfExists= true mssql
relativeToChangelogFile Defines whether the file path is relative to the changelog file rather than looked up in the search path. all
replaceIfExists If the stored procedure defined by procedureName already exits, alter it instead of creating it. mssql

Name of the schema


Database support

Database Notes Auto Rollback
DB2/LUW Supported Yes
DB2/z Supported Yes
Derby Supported Yes
Firebird Supported Yes
H2 Supported Yes
HyperSQL Supported Yes
INGRES Supported Yes
Informix Supported Yes
MariaDB Supported Yes
MySQL Supported Yes
Oracle Supported Yes
PostgreSQL Supported Yes
Snowflake Supported Yes
SQL Server Supported Yes
SQLite Not Supported No
Sybase Supported Yes
Sybase Anywhere Supported Yes