Subject | DataTruncation on UPDATE/INSERT |
---|---|
Author | Robert DiFalco |
Post date | 2004-12-01T00:25:52Z |
If I define a table like so:
CREATE TABLE Test (
m_value VARCHAR(255),
);
Using UNICODE_FSS as the encoding. If I then do this:
ps = con.prepareStatement( "INSERT INTO Test(m_value) VALUES (?);" );
ps.setString( 1, makeString( "A", 193 ) );
ps.execute();
con.commit();
public String makeString( String ch, int len )
{
StringBuffer buffer = new StringBuffer();
while ( len-- > 0 )
buffer.append( ch );
return buffer.toString();
}
I get a DataTruncation exception saying that the transfer size is 192
and that I attempted to write a string one character larger (i.e. 193).
But from IBExpert, I have no problem adding a string of 255 characters
(the same characters) into this field.
Why does JayBird think the max size of the field is 192? Am I doing
something wrong?
R.
CREATE TABLE Test (
m_value VARCHAR(255),
);
Using UNICODE_FSS as the encoding. If I then do this:
ps = con.prepareStatement( "INSERT INTO Test(m_value) VALUES (?);" );
ps.setString( 1, makeString( "A", 193 ) );
ps.execute();
con.commit();
public String makeString( String ch, int len )
{
StringBuffer buffer = new StringBuffer();
while ( len-- > 0 )
buffer.append( ch );
return buffer.toString();
}
I get a DataTruncation exception saying that the transfer size is 192
and that I attempted to write a string one character larger (i.e. 193).
But from IBExpert, I have no problem adding a string of 255 characters
(the same characters) into this field.
Why does JayBird think the max size of the field is 192? Am I doing
something wrong?
R.