Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: [?] pl/sql string function
"Poguedauff" <pogue_at_pogue.it> wrote:
>I am trying to write an SQL statement that insert in the leftmost part of a
>varchar2 n blanks where n is the length of the field minus the existing
>characters of the field.
>An example:
>
>field name = pippo
>field size = 8 (varchar2)
>field value = 'ABC'
>
>what I want the field value to be is = ' ABC'
>
>Did anybody have the same problem? Any suggestion (specially for inserting n
>blanks , I know how I can calculate the n value withe the length function)?
>
>Thanks in advance to everybody.
>
>
>
>
try substr(lpad(' ',lenght(pippo)) || pippo,-lenght(pippo))
Received on Wed Nov 03 1999 - 07:33:05 CST