List:MySQL and Java« Previous MessageNext Message »
From:Luca Lafranchi Date:January 21 2003 6:02pm
Subject:Re: Possible bug in PreparedStatement.setString(int,String) ?
View as plain text  
> Nope. It's a feature. See http://www.mysql.com/doc/en/CHAR.html
> 
> "However, in contrast to CHAR, VARCHAR values are stored using only as 
> many characters as are needed, plus one byte to record the length. 
> Values are not padded; instead, trailing spaces are removed when values 
> are stored. (This space removal differs from the ANSI SQL specification.)"
> 

Ok, but then how do I store and retrieve a string with trailing spaces, 
given that even with CHAR columns those spaces are "removed upon retrieval"?

Thanks
Luca


Thread
Possible bug in PreparedStatement.setString(int,String) ?Luca Lafranchi21 Jan
  • Re: Possible bug in PreparedStatement.setString(int,String) ?Mark Matthews21 Jan
  • Re: Possible bug in PreparedStatement.setString(int,String) ?Luca Lafranchi21 Jan
    • Re: Possible bug in PreparedStatement.setString(int,String) ?Mark Matthews21 Jan
      • load file errorRemoved13 Nov
    • installation problemRemoved13 Nov
  • Re: Possible bug in PreparedStatement.setString(int,String) ?Luca Lafranchi22 Jan