utl_lms , and especially the format_message()procedure of this package can be used to format the string.
begin
dbms_output.put_line(utl_lms.format_message('Hi %s! How are you %s?.'
, 'John'
, 'John'
)
);
end;
Result:
Hi John! How are you John?.
It should be noted that:
- It only works in the PLS / SQL block, not in SQL.
- (
%s , %d ), .