Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Fill with blanks(spaces) a VARCHAR2 type

Rosario VigilanteJun 29 2007 — edited Jun 29 2007
Thanks in advance,

I have a VARCHAR2 type rtesta's var of length x(100 char)

how i can fill(write) it without create a other varchar2 var that it'll be only filled with blanks(spaces). e.g

rtesta := ' PC'||fil1||'xxx||fill2....

where fil1 = say 10 spaces.. fill2 = 63 spaces and so on

I would like something as

rtesta := ' PC'|| RPAD(null,10)||'xxx||RPAD(null,63) ...

but.... Oracle treats an empty string as null. And nulls are always a bit special within Oracle. Particularly, rpad('', n) and lpad('', n) returns null.

Exists a built in for my problem?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 27 2007
Added on Jun 29 2007
4 comments
3,871 views