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 <[email protected]> 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?
>

Reply via email to