日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle 数字不用,oracle – Plsql将数字(货币)拼写为意大利货币而不用硬编码的翻译编号...

發布時間:2025/3/20 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle 数字不用,oracle – Plsql将数字(货币)拼写为意大利货币而不用硬编码的翻译编号... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我找不到自動發布的帖子,因為我不想硬編碼英語和意大利語之間的映射.

有沒有辦法將拼寫編號寫入PLSQL,Oracle 10g或11i中的任何語言?

我沒有這個內置包:我的oracle中的AP_AMOUNT_UTILITIES_PKG.

CREATE OR REPLACE FUNCTION Currency_conversion(currency IN NUMBER)

RETURN VARCHAR2 IS

txt varchar2(4000);

tlum varchar2(4000);

babelTxt varchar(32000);

req utl_http.req;

resp utl_http.resp;

webtext VARCHAR2(4000);

webextract VARCHAR2(4000);

BEGIN

-- This is used to convert number to words in english

SELECT CAST( to_char( to_timestamp( lpad(currency,9,'0'), 'FF9' ), 'FFSP' ) AS VARCHAR2(100) )

into txt from dual;

-- FFSP is used to spell Fraction second in words for example HH24SP

-- can be used to spell hours from 0 to 23,i used FFSP to get max range

txt:=translate(txt,'x-','x ');

-- The below logic is taken from

-- https://forums.oracle.com/forums/thread.jspa?threadID=1122273(and)start=15(and) tstart=0

--need to test once

-- request that exceptions are raised for error status codes

utl_http.set_response_error_check(enable => TRUE);

-- allow testing for exceptions like Utl_Http.Http_Server_Error

utl_http.set_detailed_excp_support(enable => TRUE);

txt:=utl_url.escape(txt);

babelTxt := 'http://babelfish.yahoo.com/translate_txt?doit=done' || '&' || 'lp=en_it' || '&' || 'intl=1' || '&' || 'ei=utf8' || '&' || 'trtext=' || txt;

req:=utl_http.begin_request(url => babelTxt, method => 'GET');

resp := utl_http.get_response(r => req);

BEGIN

LOOP

--utl_http.read_text(r => resp, data => webtext, len => 32767);

utl_http.read_line(r => resp , data => webtext);

webextract := regexp_substr(webtext,'

(.+)');

if webextract is not null

then

select regexp_replace(webextract,'

(.+)','\1')

into tlum FROM dual;

end if;

exit when tlum is not null;

END LOOP;

EXCEPTION

WHEN utl_http.end_of_body THEN

NULL;

END;

utl_http.end_response(r => resp);

return tlum;

EXCEPTION

WHEN OTHERS THEN

dbms_output.put_line(SQLERRM);

return '';

END;

/

exit;

總結

以上是生活随笔為你收集整理的oracle 数字不用,oracle – Plsql将数字(货币)拼写为意大利货币而不用硬编码的翻译编号...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。