db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suat Gonul <suatgo...@gmail.com>
Subject Exception while inserting a record
Date Thu, 13 Sep 2012 08:31:02 GMT
Hi everyone,

I have a table having two columns: id (Primary key, varchar 1024),
revision(long). There is also an index on the revision field.

I can insert records in which the id has more than 128 characters into
this table using PreparedStatement when the query is as follows:
INSERT INTO table (id,revision) VALUES(?, ?). If the query is as
follows: INSERT INTO table (id,revision) VALUES(<value having more than
128 characters>, 1) or if I use the regular Statement object,
I get an exception as follows:

Caused by: java.sql.SQLSyntaxErrorException: The name
'aaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbb'
is too long. The maximum length is '128'.
    at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
Source)
    at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown
Source)
    at
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown
Source)
    at
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown
Source)
    at
org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
    at
org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown
Source)
    at
org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
    at
org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
    at
org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
    at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown
Source)
    at
org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
    at
org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
    at
org.apache.stanbol.contenthub.web.resources.TestResource.addCustomRecord(TestResource.java:480)
    ... 61 more
Caused by: java.sql.SQLException: The name
'aaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbb'
is too long. The maximum length is '128'.
    at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
    at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source)
    ... 75 more
Caused by: ERROR 42622: The name
'aaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbbaaaaabbbbb'
is too long. The maximum length is '128'.
    at
org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
    at
org.apache.derby.iapi.util.IdUtil.checkIdentifierLengthLimit(Unknown Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.columnReference(Unknown Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.valueExpressionPrimary(Unknown
Source)
    at org.apache.derby.impl.sql.compile.SQLParser.primary(Unknown Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.primaryExpressionXX(Unknown
Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.primaryExpression(Unknown
Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.unaryExpression(Unknown Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.multiplicativeExpression(Unknown
Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.additiveExpression(Unknown
Source)
    at org.apache.derby.impl.sql.compile.SQLParser.predicate(Unknown Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.booleanPrimary(Unknown Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.isSearchCondition(Unknown
Source)
    at org.apache.derby.impl.sql.compile.SQLParser.andExpression(Unknown
Source)
    at org.apache.derby.impl.sql.compile.SQLParser.orExpression(Unknown
Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.rowValueConstructorElement(Unknown
Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.rowValueConstructorList(Unknown
Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.rowValueConstructor(Unknown
Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.tableValueConstructorList(Unknown
Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.tableValueConstructor(Unknown Source)
    at org.apache.derby.impl.sql.compile.SQLParser.simpleTable(Unknown
Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.nonJoinQueryPrimary(Unknown
Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.nonJoinQueryTerm(Unknown Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.queryExpression(Unknown Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.insertColumnsAndSource(Unknown
Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.insertStatement(Unknown Source)
    at
org.apache.derby.impl.sql.compile.SQLParser.preparableSQLDataStatement(Unknown
Source)
    at org.apache.derby.impl.sql.compile.SQLParser.StatementPart(Unknown
Source)
    at org.apache.derby.impl.sql.compile.SQLParser.Statement(Unknown Source)
    at
org.apache.derby.impl.sql.compile.ParserImpl.parseStatement(Unknown Source)
    at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
    at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
    at
org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown
Source)

Am I doing something wrong?

Best,
Suat

Mime
View raw message