question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Informix can't create formatted sql procedure

See original GitHub issue

Environment

Mac, using docker containers for db

Liquibase Version: Liquibase Pro 4.0.0

Liquibase Integration & Version: <Pick one: CLI, maven, gradle, spring boot, servlet, etc.> CLI

Liquibase Extension(s) & Version: n/a

Database Vendor & Version: IBM Informix Dynamic Server Version 14.10.FC3DE

Operating System Type & Version: Mac 10.15.5

Description

I can run the following procedure in DBeaver and it works:

CREATE PROCEDURE raise_prices ( per_cent INT)
	UPDATE stock SET unit_price = unit_price + (unit_price * (per_cent/100) );
END PROCEDURE;

But can’t get it to work as a changeset

Steps To Reproduce

  1. Make sure liquibase.properties is pointing to an Informix DB
  2. Add the following changeset to your changelog
--changeset ronak:5
--comment: test out stored logic: Procedures
CREATE PROCEDURE raise_prices ( per_cent INT)
	UPDATE stock SET unit_price = unit_price + (unit_price * (per_cent/100) );
END PROCEDURE;
  1. Save
  2. Run liquibase update

List the steps to reproduce the behavior.

  • I ran my container with the following calls: docker pull ibmcom/informix-developer-database docker run --name ronakInformix -e DBSERVERNAME=dbserver -e LICENSE=accept -e LOCAL=true -p 9088:9088 -e DBA_USER=test -e DBA_PASS=test ibmcom/informix-developer-database

Actual Behavior

Console output:

ronak@Ronaks-MacBook-Pro informix % liquibase update Liquibase Pro 4.0.0 by Datical licensed to Liquibase Pro Customer until Mon May 17 19:00:00 CDT 2021 Starting Liquibase at 21:14:47 (version 4.0.0 #19 built at 2020-07-13 19:45+0000) Unexpected error running Liquibase: Migration failed for change set dbchangelog.sql::5::ronak: Reason: liquibase.exception.DatabaseException: A syntax error has occurred. [Failed SQL: (-201) CREATE PROCEDURE raise_prices ( per_cent INT) UPDATE stock SET unit_price = unit_price] For more information, please use the --logLevel flag [2020-08-03 21:14:48] SEVERE [liquibase.integration] Unexpected error running Liquibase: Migration failed for change set dbchangelog.sql::5::ronak: Reason: liquibase.exception.DatabaseException: A syntax error has occurred. [Failed SQL: (-201) CREATE PROCEDURE raise_prices ( per_cent INT) UPDATE stock SET unit_price = unit_price] liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for change set dbchangelog.sql::5::ronak: Reason: liquibase.exception.DatabaseException: A syntax error has occurred. [Failed SQL: (-201) CREATE PROCEDURE raise_prices ( per_cent INT) UPDATE stock SET unit_price = unit_price] at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:112) at liquibase.Liquibase$1.run(Liquibase.java:206) at liquibase.Scope.lambda$child$0(Scope.java:159) at liquibase.Scope.child(Scope.java:170) at liquibase.Scope.child(Scope.java:158) at liquibase.Scope.child(Scope.java:137) at liquibase.Liquibase.runInScope(Liquibase.java:1790) at liquibase.Liquibase.update(Liquibase.java:183) at liquibase.Liquibase.update(Liquibase.java:179) at liquibase.integration.commandline.Main.doMigration(Main.java:1543) at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:316) at liquibase.Scope.lambda$child$0(Scope.java:159) at liquibase.Scope.child(Scope.java:170) at liquibase.Scope.child(Scope.java:158) at liquibase.Scope.child(Scope.java:137) at liquibase.Scope.child(Scope.java:183) at liquibase.Scope.child(Scope.java:187) at liquibase.integration.commandline.Main$1.run(Main.java:315) at liquibase.integration.commandline.Main$1.run(Main.java:166) at liquibase.Scope.child(Scope.java:170) at liquibase.Scope.child(Scope.java:144) at liquibase.integration.commandline.Main.run(Main.java:166) at liquibase.integration.commandline.Main.main(Main.java:145) Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set dbchangelog.sql::5::ronak: Reason: liquibase.exception.DatabaseException: A syntax error has occurred. [Failed SQL: (-201) CREATE PROCEDURE raise_prices ( per_cent INT) UPDATE stock SET unit_price = unit_price] at liquibase.changelog.ChangeSet.execute(ChangeSet.java:670) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:49) at liquibase.changelog.ChangeLogIterator$2$1.run(ChangeLogIterator.java:99) at liquibase.Scope.lambda$child$0(Scope.java:159) at liquibase.Scope.child(Scope.java:170) at liquibase.Scope.child(Scope.java:158) at liquibase.Scope.child(Scope.java:137) at liquibase.Scope.child(Scope.java:183) at liquibase.Scope.child(Scope.java:187) at liquibase.changelog.ChangeLogIterator$2.run(ChangeLogIterator.java:91) at liquibase.Scope.lambda$child$0(Scope.java:159) at liquibase.Scope.child(Scope.java:170) at liquibase.Scope.child(Scope.java:158) at liquibase.Scope.child(Scope.java:137) at liquibase.Scope.child(Scope.java:183) at liquibase.Scope.child(Scope.java:187) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:64) … 22 more Caused by: liquibase.exception.DatabaseException: A syntax error has occurred. [Failed SQL: (-201) CREATE PROCEDURE raise_prices ( per_cent INT) UPDATE stock SET unit_price = unit_price] at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:398) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:82) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:154) at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1272) at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1254) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:635) … 38 more Caused by: java.sql.SQLSyntaxErrorException: A syntax error has occurred. at com.informix.util.IfxErrMsg.buildExceptionWithMessage(IfxErrMsg.java:408) at com.informix.util.IfxErrMsg.buildIsamException(IfxErrMsg.java:401) at com.informix.jdbc.IfxSqli.addException(IfxSqli.java:3021) at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.java:3272) at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2269) at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2194) at com.informix.jdbc.IfxSqli.executeExecute(IfxSqli.java:2104) at com.informix.jdbc.IfxResultSet.executeExecute(IfxResultSet.java:302) at com.informix.jdbc.IfxStatement.executeImpl(IfxStatement.java:1006) at com.informix.jdbc.IfxStatement.executeImpl(IfxStatement.java:986) at com.informix.jdbc.IfxStatement.executeBody(IfxStatement.java:738) at com.informix.jdbc.IfxStatement.execute(IfxStatement.java:680) at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:394) … 43 more

Expected/Desired Behavior

A clear and concise description of what happens in the software after this pull request. DBeaver is able to execute the sql, I expect LB to also.

Screenshots (if appropriate)

If applicable, add screenshots to help explain your problem.

Additional Context

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
molivasdatcommented, Aug 5, 2020

Hi @ro-rah . Thanks for the detailed explanation and recreation steps of this issue. We will add it to our list and process it as we can. But to answer your question, it looks as though from this issue that procedures may be broken.

0reactions
ro-rahcommented, Aug 10, 2020

Closing!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't create Informix stored procedure using ISQL command?
1 Answer 1 · Use DB-Access instead of ISQL to create stored procedures. · Obtain SQLCMD from the IIUG Software Archive and use...
Read more >
IBM Informix Messages and Corrections
For more information, see the discussion of SQLCODE in the IBM Informix ... You cannot create a temporary table to include the replication...
Read more >
informix stored procedure - 'Cannot parse source code for ...
Hi @ all, I'm using DBvis 6.5 connecting to our Informix DB via Informix Dynamic Server 10.00.UC6 IBM Informix JDBC Driver for IBM...
Read more >
PowerBuilder Troubleshooting Guide Database
Symptom. After successfully connecting to an Informix 11.7 database using the I10 driver, a SQL statement in the dynamic SQL format 2 is...
Read more >
create procedure - Informix Guide to SQL: Syntax
An INFORMIX-ESQL/C program cannot directly create a stored procedure or external procedure. That is, it cannot contain the CREATE PROCEDURE statement.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found