Is there an equivalent or alternative to the following?
SELECT mix_type || \' (\' || mix_num || \')\' as description
FROM acid_batch
WHERE mix_num < 10
The closest standard approximation to printf for Oracle I can think of is utl_lms.format_message. However, it won't work in SQL statements, that is, this is ok:
begin
dbms_output.put_line(
utl_lms.format_message('hello %s, the number is %d', 'world', 42)
);
end;
/
but this gives a ORA-00902: invalid datatype error:
select utl_lms.format_message('hello %s, the number is %d', 'world', 42)
from dual