【发布时间】:2020-09-07 13:48:32
【问题描述】:
这是我在流程代码中使用的 Plsql 代码,但由于 l_receipt_date 列,我收到了字符到数字转换的错误 我需要将日期插入为 'YYYY-MM-DD' 格式,如下所述,所以我在进程中使用了以下代码,l_receipt_date:=to_char(:P4_RECEIPT_DATE,'YYYY-MM-DD'); ,由于上面的这一行,我得到了错误。这是我在进程代码中使用的 Plsql 代码,但我得到的错误是字符到数字的转换,这是由于 l_receipt_date 列
DECLARE
l_clob CLOB;
l_emp_no NUMBER;
l_status VARCHAR2(100);
l_employee_name VARCHAR2(100);
l_id NUMBER;
l_employee_salary NUMBER;
l_employee_age NUMBER;
l_request_url VARCHAR2(200);
l_body_clob clob;
x_err varchar2(2000);
l_receipt_date varchar2(1000);
begin
l_request_url := 'https://fa-eoxd-test-saasfaprod1.fa.ocs.oraclecloud.com/fscmRestApi/resources/latest/standardReceipts/';
apex_web_service.g_request_headers(1).name := 'Content-Type';
apex_web_service.g_request_headers(1).value := 'application/json';
l_receipt_date:=to_char(:P4_RECEIPT_DATE,'YYYY-MM-DD');
l_body_clob:='{
"ReceiptNumber":"'||:P4_RECEIPT_NUMBER||'"
,"BusinessUnit":"'||:P4_OPERATING_UNIT_NAME||'"
,"ReceiptMethod":"'||:P4_RECEIPT_METHOD||'"
,"ReceiptDate":"'||l_receipt_date||'"
}';
l_clob :=
APEX_WEB_SERVICE.MAKE_REST_REQUEST(
p_url => l_request_url,
p_http_method => 'POST',
p_username => 'fin.user',
p_password => 'Fusion@123',
p_body => l_body_clob) ;
htp.p(l_clob);
exception when others then
x_err:=sqlerrm;
htp.p(x_err);
END;
【问题讨论】:
标签: oracle-apex plsqldeveloper oracle-apex-5 oracle-apex-5.1