# Liquibase Teradata 5526 error when creating any stored procedure

**URL:** <https://forum.liquibase.org/t/liquibase-teradata-5526-error-when-creating-any-stored-procedure/8763>\
**Category:** General Discussion\
**Created:** [October 26, 2023, 3:46pm UTC](https://forum.liquibase.org/t/liquibase-teradata-5526-error-when-creating-any-stored-procedure/8763 "2023-10-26T15:46:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![klemke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/klemke/32/1093_2.png) [@klemke](https://forum.liquibase.org/u/klemke)\
**Post date:** [October 26, 2023, 3:46pm UTC](https://forum.liquibase.org/t/liquibase-teradata-5526-error-when-creating-any-stored-procedure/8763/1 "2023-10-26T15:46:08Z")

</div>

I am having an issue with any Liquibase 4.0 or higher with Teradata. To test, I created a new Teradata database and a xml file with a single changeset:

```auto
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
				xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.24.xsd">
	<changeSet id="test" author="klemke">
		<sql>
			<![CDATA[
			create procedure DBname.SP_TEST(IN "param1" VARCHAR(30))
			BEGIN
				INSERT INTO TEST_TABLE (COL1) VALUES (:param1);
			END;
			]]>
		</sql>
	</changeSet>
</databaseChangeLog>

```

When I execute it, or any other Create/Replace Procedure call, whether it be in or , I get:  
Caused by: liquibase.exception.DatabaseException: [Teradata Database] [TeraJDBC 20.00.00.13] [Error 5526] [SQLState HY000] Stored Procedure is not created/replaced due to error(s).

I can log in as the same user I am connecting Liquibase as and create the stored procedure manually without an issue. I can create a tables using Liqubase, just not stored procedures.

Stack trace from Liquibase changeset failure:  
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:785)  
at liquibase.changelog.visitor.UpdateVisitor.executeAcceptedChange(UpdateVisitor.java:118)  
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:68)  
at liquibase.changelog.ChangeLogIterator$2.lambda$run$0(ChangeLogIterator.java:110)  
at liquibase.Scope.lambda$child$0(Scope.java:184)  
at liquibase.Scope.child(Scope.java:193)  
at liquibase.Scope.child(Scope.java:183)  
at liquibase.Scope.child(Scope.java:162)  
at liquibase.Scope.child(Scope.java:250)  
at liquibase.changelog.ChangeLogIterator$2.run(ChangeLogIterator.java:100)  
at liquibase.Scope.lambda$child$0(Scope.java:184)  
at liquibase.Scope.child(Scope.java:193)  
at liquibase.Scope.child(Scope.java:183)  
at liquibase.Scope.child(Scope.java:162)  
at liquibase.Scope.child(Scope.java:250)  
at liquibase.Scope.child(Scope.java:254)  
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:74)  
… 38 more  
And from error report:  
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:468)  
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:77)  
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:177)  
at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1291)  
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1273)  
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:744)  
… 54 more

I have tried with Liquibase 4.24.0, 4.19.1, 4.9.1 - they all had the same error.  
If I use 3.4.1, it works fine, no matter if it is an existing database or a new one.  
Teradata 17.20.03.02  
Classpath includes tdgssconfig.jar, liquibase-teradata.jar, and terajdbc.jar; also tried terajdbc4.jar.

Any ideas why it cannot create a stored procedure? Or is there a way to get more information on the cause of the error since the error code seems to be pretty generic?

---

<div class="post-metadata">

**Author:** ![daryldoak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/daryldoak/32/764_2.png) [@daryldoak](https://forum.liquibase.org/u/daryldoak)\
**Post date:** [October 26, 2023, 5:23pm UTC](https://forum.liquibase.org/t/liquibase-teradata-5526-error-when-creating-any-stored-procedure/8763/2 "2023-10-26T17:23:55Z")

</div>

I would recommend avoiding the CDATA method, instead just use native sql. The only change you need to make is to set the endDelimiter, since the default statement delimiter is semicolon, which doesn’t work for procedure code.

```auto
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
				xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.24.xsd">
	<changeSet id="test" author="klemke">
		<sql endDelimiter="/">
			create procedure DBname.SP_TEST(IN "param1" VARCHAR(30))
			BEGIN
				INSERT INTO TEST_TABLE (COL1) VALUES (:param1);
			END;
            /
		</sql>
	</changeSet>
</databaseChangeLog>

```

---

<div class="post-metadata">

**Author:** ![klemke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/klemke/32/1093_2.png) [@klemke](https://forum.liquibase.org/u/klemke)\
**Post date:** [October 27, 2023, 11:15am UTC](https://forum.liquibase.org/t/liquibase-teradata-5526-error-when-creating-any-stored-procedure/8763/3 "2023-10-27T11:15:04Z")

</div>

Thank you for responding. Unfortunately, I got the same error:  
Caused by: liquibase.exception.DatabaseException: [Teradata Database] [TeraJDBC 20.00.00.13] [Error 5526] [SQLState HY000] Stored Procedure is not created/replaced due to error(s). [Failed SQL: (5526) create procedure DBname.SP\_TEST(IN “param1” VARCHAR(30)) END;] INSERT INTO TEST\_TABLE (COL1) VALUES (:param1);

To duplicate on a Windows machine, download VirtualBox, install Teradata Vantage Express, create a test database, and then run the changeset with any version of Liquibase other than 3.4.1, preferably using 4.19 or above to most closely match my environment.  
[Run Vantage Express on VirtualBox :: Teradata Getting Started](https://quickstarts.teradata.com/getting.started.vbox.html)

My command line in case this helps:  
liquibase --changeLogFile=test.changelog.xml --url=jdbc:teradata://192.168.56.1/DATABASE=DBNAME --driver=com.teradata.jdbc.TeraDriver --classpath=‘./liquibase-teradata.jar;./tdgssconfig.jar;./terajdbc4.jar’ --logLevel=debug update

---

<div class="post-metadata">

**Author:** ![klemke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/klemke/32/1093_2.png) [@klemke](https://forum.liquibase.org/u/klemke)\
**Post date:** [November 2, 2023, 1:36pm UTC](https://forum.liquibase.org/t/liquibase-teradata-5526-error-when-creating-any-stored-procedure/8763/4 "2023-11-02T13:36:57Z")

</div>

Can anyone else duplicate this issue?

---

<div class="post-metadata">

**Author:** ![bjadav](https://avatars.discourse-cdn.com/v4/letter/b/7993a0/32.png) [@bjadav](https://forum.liquibase.org/u/bjadav)\
**Post date:** [August 4, 2025, 1:33pm UTC](https://forum.liquibase.org/t/liquibase-teradata-5526-error-when-creating-any-stored-procedure/8763/5 "2025-08-04T13:33:52Z")

</div>

I am also facing the same issue. Did you find any solution?

---

<div class="post-metadata">

**Author:** ![bjadav](https://avatars.discourse-cdn.com/v4/letter/b/7993a0/32.png) [@bjadav](https://forum.liquibase.org/u/bjadav)\
**Post date:** [August 4, 2025, 2:15pm UTC](https://forum.liquibase.org/t/liquibase-teradata-5526-error-when-creating-any-stored-procedure/8763/6 "2025-08-04T14:15:27Z")

</div>

I found a solution. We need to add splitStatements:false so that liquibase does not split the statement within SP.
