Creates a stored function
Name | Description |
---|---|
catalogName | Name of the catalogSupported by: asany, db2, db2z, derby, firebird, h2, hsqldb, informix, ingres, mariadb, mysql, oracle, postgresql, sqlite, sybaseE.g. 'cat' |
comments | E.g. 'A String' |
dbms | Logical expression of database type(s) on which the change must be applied. Valid database type names are listed on the supported databases page
It can be a comma separated list of multiple databases.
Or You can also specify that a change is NOT applicable to a particular database type by prefixing with ! . The keywords all and none are also available.@ v3.1E.g. 'h2, oracle' |
encoding | Name of the encoding (as specified in java.nio.Charset javadoc) used in the file defined in the `path` attributeDefault: 'utf-8' |
[XML: text content] / functionBody | E.g. 'A String'Note: the content of the tag in XML |
functionName | Name of the function to dropE.g. 'A String' |
path | File containing the procedure text. Either this attribute or a nested procedure text is required.E.g. 'com/example/my-logic.sql' |
[XML: text content] / procedureText | E.g. 'CREATE OR REPLACE PROCEDURE testHello IS BEGIN DBMS_OUTPUT.PUT_LINE('Hello From The Database!'); END;'Note: the content of the tag in XML |
relativeToChangelogFile | booleanWhether the file path is relative to the root changelog file rather than to the classpath. |
replaceIfExists | boolean |
schemaName | Name of the schemaE.g. 'public' |
<changeSet author="liquibase-docs" id="createFunction-example">
<pro:createFunction catalogName="cat"
comments="A String"
dbms="h2, oracle"
encoding="utf8"
functionName="A String"
path="com/example/my-logic.sql"
relativeToChangelogFile="true"
replaceIfExists="false"
schemaName="public">A String</pro:createFunction>
</changeSet>
changeSet:
id: createFunction-example
author: liquibase-docs
changes:
- createFunction:
catalogName: cat
comments: A String
dbms: h2, oracle
encoding: utf8
functionBody: A String
functionName: A String
path: com/example/my-logic.sql
procedureText: |-
CREATE OR REPLACE PROCEDURE testHello
IS
BEGIN
DBMS_OUTPUT.PUT_LINE('Hello From The Database!');
END;
relativeToChangelogFile: true
replaceIfExists: false
schemaName: public
{
"changeSet": {
"id": "createFunction-example",
"author": "liquibase-docs",
"changes": [
{
"createFunction": {
"catalogName": "cat",
"comments": "A String",
"dbms": "h2, oracle",
"encoding": "utf8",
"functionBody": "A String",
"functionName": "A String",
"path": "com/example/my-logic.sql",
"procedureText": "CREATE OR REPLACE PROCEDURE testHello\n IS\n BEGIN\n DBMS_OUTPUT.PUT_LINE('Hello From The Database!');\n END;",
"relativeToChangelogFile": true,
"replaceIfExists": false,
"schemaName": "public"
}
}]
}
}
Database | Notes | Auto Rollback |
---|---|---|
DB2/LUW | Supported | No |
DB2/z | Supported | No |
Derby | Supported | No |
Firebird | Supported | No |
H2 | Supported | No |
HyperSQL | Supported | No |
INGRES | Supported | No |
Informix | Supported | No |
MariaDB | Supported | No |
MySQL | Supported | No |
Oracle | Supported | No |
PostgreSQL | Supported | No |
SQL Server | Supported | No |
SQLite | Supported | No |
Sybase | Supported | No |
Sybase Anywhere | Supported | No |