I've analyzed SYS_OP_TRTB a little bit more, so now we have:
SYS_OP_TRTB(A,B,C,D) is a special trimming/padding function, where
A - the value for trimming/padding,
C - bytes,
D - characters.
B - this arguments accepts only literals:
when 1st bit is set to 1 (bitand(B,1)=1), this function adds spaces
(chr(32)) to right up to least(C bytes, B chars), if length of the first
argument is less than C bytes or B chars.
when 4th bit is set to 0 (bitand(B,8)=0), this functions raises ORA-01401, if
length of the first argument is less than C bytes or B chars.
I still don't know what's for 2nd and 3rd bits...
My tests:
http://orasql.org/scripts/char/test.sql
http://orasql.org/scripts/char/test2.sql
--
Best regards,
Sayan Malakshinov
Oracle performance tuning engineer
Oracle ACE Associate
http://orasql.org