我需要在不使用内置函数的情况下将 pl/sql 中的数字转换为字符串,我们应该为此使用字符串/模块操作。例如,如果输入是 123,那么输出应该是 123,任何人都可以给我关于这个的建议吗?
问问题
9056 次
1 回答
6
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.
于 2011-09-26T13:28:35.717 回答