Oracle 'printf' equivalent

前端 未结 5 1545
时光说笑
时光说笑 2021-01-04 07:31

Is there an equivalent or alternative to the following?

SELECT mix_type || \' (\' || mix_num || \')\' as description
  FROM acid_batch
 WHERE mix_num < 10         


        
5条回答
  •  情深已故
    2021-01-04 08:05

    No there are no built-in Oracle functions that apply a formatting string in this fashion. Although it would be easy to write a custom function for this specific example, writing a PL/SQL-based implementation of printf would be challenging.

    If you have a frequent need for this, perhaps you could write an Oracle function that wraps a Java call for a richer string handling environment.

提交回复
热议问题