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!

A quick way to repeat characters...

jgrantMay 5 2006 — edited May 5 2006
Hi,

What is the best way to repeat a certain character? For example, I am concatenating a number of values together into one string variable inside a stored proc. Something like this:

v_output_rec varchar2;
v_output_rec := '01' || 'text A' || 'text B' || 'text C';

this works just fine. However, there is a need when I want to concatenate say, 10 'zeros'. This would look like this:

v_output_rec := '01' || '0000000000'

So, my question: is there a way to use a function to repeat 10 '0' characters? I have tried using 'Rpad()' but I can't seem to get it to work just right. Does anyone know a way to do this?

Any info would be appreciated!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 2 2006
Added on May 5 2006
3 comments
10,810 views