SQL Plus will format the columns to maintain the maximum possible value, which in this case is 255 characters.
To confirm that your output does not actually contain these extra spaces, try the following:
SELECT '/' || TRIM(A) || '/' AS COLUMN_A ,'/' || TRIM(B) || '/' AS COLUMN_B FROM MY_TABLE;
If the "/" characters are separated from your output, this means that these are not spaces, but some other space characters that fall there (for example, tabs). If so, then this is probably the input validation problem in your application.
However, the most likely scenario is that the "/" characters will actually touch the rest of your lines, thereby proving that spaces are actually trimmed.
If you want to bring them together, then Quassnoi's answer should do it.
If this is purely a display problem, then the answer given by Tony Andrews should work fine.
JosephStyons
source share