开发者

pl/sql conversion from number to string

开发者 https://www.devze.com 2023-04-07 08:08 出处:网络
i need to convert number to string in pl/sql without using the inbuilt functions , we should use stri开发者_开发知识库ng/module operations for this. for exampleif the input is 123 then the output shou

i need to convert number to string in pl/sql without using the inbuilt functions , we should use stri开发者_开发知识库ng/module operations for this. for example if the input is 123 then the output should be one hundred and twenty three can anyone give me suggestions about this pls?


You could do this in SQL or PL/SQL using the following:

In SQL:

SELECT to_char(to_date(<number_column>,'j'), 'jsp') 
  FROM <table>;

In PL/SQL:

DECLARE
  v_number NUMBER := 56;
  v_text   VARCHAR2(128);
BEGIN
  v_text := to_char(to_date(v_number,'j'), 'jsp');
END;

More information from AskTom here: http://asktom.oracle.com/pls/apex/f?p=100:11:0::NO::P11_QUESTION_ID:18305103094123#PAGETOP

I suppose it really depends upon what level of "in-built" functions you are going to artificially prevent yourself using and why?

Hope it helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号