org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [update table_name set val = COALESCE(?, val)]; nested exception is java.sql.SQLSyntaxErrorException: incompatible data types in combination

hsqldb | uprradam | 2 years ago
  1. 0

    COALESCE data types with spring-jdbc and Oracle compatibility mode

    hsqldb | 2 years ago | uprradam
    org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [update table_name set val = COALESCE(?, val)]; nested exception is java.sql.SQLSyntaxErrorException: incompatible data types in combination
  2. 0

    HyperSQL Database Engine (HSQLDB) / Bugs / #1407 incompatible data types in combination when using COALESCE in case of DATE type

    sourceforge.net | 1 year ago
    java.sql.SQLSyntaxErrorException: incompatible data types in combination Error Code: -5562 Call: SELECT ID, RELEASE_DOMAIN, RELEASE_DATE, RELEASE_VERSION, MOD_DATE, MOD_USER_ID, REC_DATE, REC_USER_ID, DESCRIPTION, NAME FROM LC_RELEASED_VERSION WHERE ((((RELEASE_DOMAIN = ?) AND (RELEASE_VERSION = COALESCE(?,RELEASE_VERSION ))) AND (NAME = COALESCE(?,NAME ))) AND (RELEASE_DATE = COALESCE(?,RELEASE_DATE ))) bind => Query: ReadAllQuery(name="ReleasedVersion.findByFilter" referenceClass=ReleasedVersion sql="SELECT ID, RELEASE_DOMAIN, RELEASE_DATE, RELEASE_VERSION, MOD_DATE, MOD_USER_ID, REC_DATE, REC_USER_ID, DESCRIPTION, NAME FROM LC_RELEASED_VERSION WHERE ((((RELEASE_DOMAIN = ?) AND (RELEASE_VERSION = COALESCE(?,RELEASE_VERSION ))) AND (NAME = COALESCE(?,NAME ))) AND (RELEASE_DATE = COALESCE(?,RELEASE_DATE )))")
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Object not found when executing query with table in a schema

    Stack Overflow | 5 months ago | aweigold
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: user lacks privilege or object not found: DIM_DATE in statement [select datedimens0_.dim_date_id as dim1_0_, datedimens0_.date as date0_, datedimens0_.hour as hour0_, datedimens0_.minute as minute0_ from analytics.dim_date datedimens0_ where datedimens0_.date=? and (? is null or datedimens0_.hour=?) and (? is null or datedimens0_.minute=?) limit ?]
  5. 0

    org.hsqldb.HsqlException: user lacks privilege or object not found: ACCOUNT

    Stack Overflow | 5 months ago | Alesto
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not prepare statement

  1. marcbouvierdav 1 times, last 1 month ago
  2. andyglick 2 times, last 3 weeks ago
  3. WoodenDoors 67 times, last 7 months ago
87 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.hsqldb.HsqlException

    incompatible data types in combination

    at org.hsqldb.error.Error.error()
  2. HyperSQL Database
    Error.error
    1. org.hsqldb.error.Error.error(Unknown Source)
    2. org.hsqldb.error.Error.error(Unknown Source)
    2 frames
  3. HSQLDB
    JDBCConnection.prepareStatement
    1. org.hsqldb.types.CharacterType.getAggregateType(Unknown Source)
    2. org.hsqldb.types.NumberType.getAggregateType(Unknown Source)
    3. org.hsqldb.types.Type.getAggregateType(Unknown Source)
    4. org.hsqldb.ExpressionOp.resolveTypesForCaseWhen(Unknown Source)
    5. org.hsqldb.ExpressionOp.resolveTypes(Unknown Source)
    6. org.hsqldb.ParserDML.resolveUpdateExpressions(Unknown Source)
    7. org.hsqldb.ParserDML.compileUpdateStatement(Unknown Source)
    8. org.hsqldb.ParserCommand.compilePart(Unknown Source)
    9. org.hsqldb.ParserCommand.compileStatement(Unknown Source)
    10. org.hsqldb.Session.compileStatement(Unknown Source)
    11. org.hsqldb.StatementManager.compile(Unknown Source)
    12. org.hsqldb.Session.execute(Unknown Source)
    13. org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source)
    14. org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
    14 frames
  4. Commons DBCP
    PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement
    1. org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:281)
    2. org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:313)
    2 frames
  5. Spring Framework
    NamedParameterJdbcTemplate.update
    1. org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.createPreparedStatement(PreparedStatementCreatorFactory.java:245)
    2. org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:581)
    3. org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
    4. org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    5. org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:603)
    6. org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:812)
    7. org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:834)
    8. org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:261)
    8 frames
  6. example
    DemoClass.testCoalesce
    1. example.DemoClass.testCoalesce(DemoClass.java:33)
    1 frame
  7. Java RT
    DelegatingMethodAccessorImpl.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    3 frames
  8. JUnit
    InvokeMethod.evaluate
    1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    4 frames
  9. Spring TestContext
    SpringJUnit4ClassRunner.runChild
    1. org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
    2. org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
    3. org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
    4. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
    5. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)
    5 frames
  10. JUnit
    ParentRunner$2.evaluate
    1. org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    2. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    3. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    4. org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    5. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    5 frames
  11. Spring TestContext
    RunAfterTestClassCallbacks.evaluate
    1. org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    2. org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
    2 frames
  12. JUnit
    ParentRunner.run
    1. org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    1 frame
  13. Spring TestContext
    SpringJUnit4ClassRunner.run
    1. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
    1 frame
  14. JUnit
    JUnitCore.run
    1. org.junit.runners.Suite.runChild(Suite.java:127)
    2. org.junit.runners.Suite.runChild(Suite.java:26)
    3. org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    4. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    5. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    6. org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    7. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    8. org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    9. org.junit.runner.JUnitCore.run(JUnitCore.java:160)
    9 frames
  15. IntelliJ junit4 module
    JUnit4IdeaTestRunner.startRunnerWithArgs
    1. com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
    1 frame
  16. IDEA
    JUnitStarter.main
    1. com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
    2. com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
    2 frames
  17. Java RT
    NativeMethodAccessorImpl.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    2 frames
  18. IDEA
    AppMain.main
    1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
    1 frame