MuleSoft · Database Connector

DB:BAD_SQL_SYNTAX

Short answer

DB:BAD_SQL_SYNTAX means the SQL query you gave Database Connector contains invalid syntax. Correct the statement for your database, and check any part of it that is built dynamically.

VerifiedLast verified

01Error text

MuleSoft error
Error type: DB:BAD_SQL_SYNTAX

02Likely causes

  • The provided SQL query contains invalid syntax.
  • On Snowflake, a callable statement written with curly brackets fails with net.snowflake.client.jdbc.SnowflakeSQLException: Unsupported feature 'call'.

03How to fix it

  1. Read the SQL text of the failing operation and correct the syntax for the database you are connected to.
  2. For Snowflake stored procedures, write the statement without curly brackets, for example call doubleMyInt(:myInt).
  3. Turn on verbose logging to see the statement that was sent: add AsyncLogger entries at DEBUG for org.mule.extension.db and org.mule.db.commons in log4j2.xml. Turn it off afterward.
  4. Handle the failure with an error handler of type DB:BAD_SQL_SYNTAX if the SQL is built from input you do not control.

04Official documentation

Test every fix in a non-production environment before you apply it to production. See how entries are verified.

More for MuleSoft work:Open MuleSoft jobsMuleSoft rates and salariesHire a senior MuleSoft developer

The iPaaS Brief

Subscribe to The iPaaS Brief.

The iPaaS newsletter for the people who run integrations. From iPaaS Group.

Free. You finish on theipaasbrief.com and confirm by email.