當我嘗試輸出回應時,如何使用 apex webservice 發出請求顯示來自此端點的回應我得到 ORA-06502: PL/SQL: numeric or value 錯誤。當我在郵遞員上測驗時,我正在呼叫的 api 回傳一個字串。下面是我的 PLSQL 代碼。
declare
j_string clob;
begin
j_string := apex_web_service.make_rest_request(p_url => 'http://localhost/api/public/cerificate', p_http_method => 'POST',
p_body => '{
"name": "Jonh West",
"gender": "Male",
"dob": "sep-02-1977",
"occupation": "Trader",
"address": "NO 33 Mudupe Street Ikeja Lagos",
"mobile": "08131500000",
"email": "[email protected]",
"kinName": "James West",
"kinMobile": "08145600000",
"kinEmail": "[email protected]",
"coverPlan": "BRONZE",
"coverMedical": "20000",
"coverPDisability": "30000",
"coverTDisability": "15000",
"coverDeath": "44000",
"aPremiuum": "80000"
}');
dbms_output.put_line(j_string);
end ;
這是我得到的錯誤: ORA-06502: PL/SQL: numeric or value error ORA-06512: at line 23 ORA-06512: at "SYS.DBMS_SQL", line 1721
- 宣布
- j_string clob;
- 開始
- j_string := apex_web_service.make_rest_request(p_url => 'http://localhost/api/public/cerificate', p_http_method => 'POST',
uj5u.com熱心網友回復:
行號表示錯誤是由dbms_output.put_line. 它期待一個字串,但得到一個可能是錯誤原因的 clob 值。我會嘗試以下方法:
dbms_output.put_line(dbms_lob.substr ( j_string, 4000, 1 ));
看看這是否有效。
附帶說明一下,將變數“.._string”命名為實際上是一個 CLOB 是令人困惑的 :)
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/530926.html
上一篇:每次觸發器需要以不同的ORA錯誤運行時,TRIGGERAUTONOMOSTRANSACTION都會失敗
下一篇:加密資料庫或程式中的資料
