Im building this string:
text_ := 'NAME LNAME AGE'||chr(13)||chr(10);
FOR person_ IN list LOOP
text_ := text_ ||person_.name||' '||person_.lname||' '||person_.age||chr(13)||chr(10);
END LOOP;
Loop will result in:
NAME LNAME AGE
name lname 18
namename lname 18
Desired result:
NAME LNAME AGE
name lname 18
namename lname 18
Is there a way to tell a string to fill itself with whitespace if the value within it doesn't reach a fixed value?
Using RPAD:
text_ := text_||rpad('Name', 30)||rpad('Date', 12)||chr(13)||chr(10)||chr(13)||chr(10);
FOR op_ IN get_op LOOP
text_ := text_||rpad(op_.NAME, 30)||rpad(op_.DATE,12)||chr(13)||chr(10);
END LOOP;
Results in:
Name Date
UserUserUser 2014-04-03
UserUser 2014-04-04
UserUser 2014-04-03