java.sql.SQLException: Argument data type text is invalid for argument 1 of lower function.

Atlassian JIRA | Dave Loeng [Atlassian] | 1 decade ago
  1. 0

    Running it results in this exception: When I performed the first step of the test described in this link: http://confluence.atlassian.com/display/DOC/Troubleshooting+Character+Encodings I get the following error stack: Cause: java.sql.SQLException: Argument data type text is invalid for argument 1 of lower function. Stack Trace: [hide] java.sql.SQLException: Argument data type text is invalid for argument 1 of lower function. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:628) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:418) at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:693) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:75) at com.atlassian.confluence.admin.actions.debug.EncodingTestAction.retrieveLowerDatabaseTestString(EncodingTestAction.java:106) at com.atlassian.confluence.admin.actions.debug.EncodingTestAction.execute(EncodingTestAction.java:64) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165) at com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.intercept(DefaultWorkflowInterceptor.java:55) at com.atlassian.confluence.core.ConfluenceWorkflowInterceptor.intercept(ConfluenceWorkflowInterceptor.java:39) This is because the LOWER function in MS SQL can only be performed on fields that can be converted into a varchar (the BODYCONTENT.BODY column that the encoding test is trying to lower is a TEXT or clob-equivalent field in MS SQL). See: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_la-lz_1pki.asp

    Atlassian JIRA | 1 decade ago | Dave Loeng [Atlassian]
    java.sql.SQLException: Argument data type text is invalid for argument 1 of lower function.
  2. 0

    Running it results in this exception: When I performed the first step of the test described in this link: http://confluence.atlassian.com/display/DOC/Troubleshooting+Character+Encodings I get the following error stack: Cause: java.sql.SQLException: Argument data type text is invalid for argument 1 of lower function. Stack Trace: [hide] java.sql.SQLException: Argument data type text is invalid for argument 1 of lower function. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:628) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:418) at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:693) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:75) at com.atlassian.confluence.admin.actions.debug.EncodingTestAction.retrieveLowerDatabaseTestString(EncodingTestAction.java:106) at com.atlassian.confluence.admin.actions.debug.EncodingTestAction.execute(EncodingTestAction.java:64) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165) at com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.intercept(DefaultWorkflowInterceptor.java:55) at com.atlassian.confluence.core.ConfluenceWorkflowInterceptor.intercept(ConfluenceWorkflowInterceptor.java:39) This is because the LOWER function in MS SQL can only be performed on fields that can be converted into a varchar (the BODYCONTENT.BODY column that the encoding test is trying to lower is a TEXT or clob-equivalent field in MS SQL). See: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_la-lz_1pki.asp

    Atlassian JIRA | 1 decade ago | Dave Loeng [Atlassian]
    java.sql.SQLException: Argument data type text is invalid for argument 1 of lower function.
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    How to use the named parameters with CONTAINS

    Stack Overflow | 4 years ago | user1940268
    org.hibernate.exception.GenericJDBCException: could not execute query
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. java.sql.SQLException

    Argument data type text is invalid for argument 1 of lower function.

    at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic()
  2. jTDS
    JtdsPreparedStatement.executeQuery
    1. net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
    2. net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
    3. net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
    4. net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:628)
    5. net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:418)
    6. net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:693)
    6 frames
  3. c3p0:JDBC DataSources/Resource Pools
    NewProxyPreparedStatement.executeQuery
    1. com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:75)
    1 frame
  4. com.atlassian.confluence
    EncodingTestAction.execute
    1. com.atlassian.confluence.admin.actions.debug.EncodingTestAction.retrieveLowerDatabaseTestString(EncodingTestAction.java:106)
    2. com.atlassian.confluence.admin.actions.debug.EncodingTestAction.execute(EncodingTestAction.java:64)
    2 frames
  5. XWork Tiger Extensions
    DefaultActionInvocation.invoke
    1. com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168)
    1 frame
  6. com.opensymphony.xwork
    AroundInterceptor.intercept
    1. com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
    1 frame
  7. XWork Tiger Extensions
    DefaultActionInvocation.invoke
    1. com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
    1 frame
  8. com.opensymphony.xwork
    DefaultWorkflowInterceptor.intercept
    1. com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.intercept(DefaultWorkflowInterceptor.java:55)
    1 frame
  9. com.atlassian.confluence
    ConfluenceWorkflowInterceptor.intercept
    1. com.atlassian.confluence.core.ConfluenceWorkflowInterceptor.intercept(ConfluenceWorkflowInterceptor.java:39)
    1 frame