Remove Trailing Blanks from Legacy Columns with the IBM OLE DB Providers
August 11, 2010 Michael Sansoterra
It’s no secret that many legacy tables in DB2 for i contain fixed-width character columns. If you present this legacy data to users using common tools such as Excel, Access, or even an application data grid control, they’re likely to be annoyed. Why? Because everyone hates fiddling with trailing spaces that are part and parcel of fixed-width columns. If you have a 50-character address column with only 20 characters filled, that leaves 30 annoying trailing spaces to remove.
Here is a picture of this annoying phenomenon shown using the classic QIWS/QCUSTCDT table displayed within an editable Windows Presentation Foundation (WPF)