1
PSOUG / Re: PL/SQL - Using Rpad function return additional whitespace
« on: December 15, 2009, 06:48:23 pm »
There is no issue with the rpad function, is only the result that I have get have return additional space even the field size is not that long. I've try execute the command provided but it have return the results as shown :-
SQL> SELECT RPAD('John Smith', 25, 'x') FROM dual;
RPAD('JOHNSMITH',25,'X')
----------------------------------------------------------------------------------------------------
John Smithxxxxxxxxxxxxxxx
SQL> SELECT RPAD('John Smith', 25) ||'<-' x FROM dual;
RPAD('JOHNSMITH',25)||'<-'
----------------------------------------------------------------------------------------------------
John Smith <-
I know the correct return result should be
RPAD('JOHNSMITH',25)||'<-'
---------------------------
John Smith <-
Is it due to any system setting which cause the above issue, as it have impact to all my scripts. Thanks.
SQL> SELECT RPAD('John Smith', 25, 'x') FROM dual;
RPAD('JOHNSMITH',25,'X')
----------------------------------------------------------------------------------------------------
John Smithxxxxxxxxxxxxxxx
SQL> SELECT RPAD('John Smith', 25) ||'<-' x FROM dual;
RPAD('JOHNSMITH',25)||'<-'
----------------------------------------------------------------------------------------------------
John Smith <-
I know the correct return result should be
RPAD('JOHNSMITH',25)||'<-'
---------------------------
John Smith <-
Is it due to any system setting which cause the above issue, as it have impact to all my scripts. Thanks.