db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suat Gonul <suatgo...@gmail.com>
Subject Re: Exception while inserting a record
Date Thu, 13 Sep 2012 10:19:17 GMT
Hi Knut,

It seems that is the problem, thanks. But, then I think I should escape
special characters contained the values. Is there standard procedure for
this? Is there a list of of special characters? What do you suggest?

Best,
Suat

On 09/13/2012 11:46 AM, Knut Anders Hatlen wrote:
> Suat Gonul <suatgonul@gmail.com> writes:
>
>> 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'.
> Hi Suat,
>
> I think you may get this message if you're using double-quotes (")
> instead of single-quotes (') around the string literal. If you use
> double-quotes, the string is interpreted as an identifier instead of a
> character string, and identifiers are limited to 128 characters. Could
> that be what you are seeing?
>


Mime
View raw message