全部。我有一个关于从 oracle 程序中获取响应的问题。这是我的程序:
PROCEDURE generate_receipt_simop(in_receipt_number IN VARCHAR2, in_inv_status IN VARCHAR2, in_kode_cabang IN VARCHAR2, out_status OUT VARCHAR2, out_message OUT VARCHAR2)is
v_result_simop NUMBER DEFAULT 0;
out_status_simop VARCHAR2(100) DEFAULT NULL;
out_errormessage_simop VARCHAR2(100) DEFAULT NULL;
v_org_id NUMBER DEFAULT 0;
BEGIN
************
EXCEPTION WHEN OTHERS THEN
logf('ROLLBACK (RECEIPT)');
ROLLBACK;
out_status := 'F';
out_message := 'GENERATE FAILED (RECEIPT) '|| in_receipt_number ||SQLERRM;
END;
我尝试使用 php 调用并读取响应,如下所示:
$param_xpi= array(
"in_receipt_number"=>"$x",
"in_receipt_status"=>"Y",
"in_kode_cabang"=>"PTK",
"out_status"=>"",
"out_message"=>""
);
$sql_xpi = "DECLARE
in_receipt_number VARCHAR2(50) DEFAULT '$x';
in_kode_cabang VARCHAR2(3) DEFAULT 'PTK';
out_status VARCHAR2(1) DEFAULT '';
out_message VARCHAR2(240) DEFAULT '';
in_inv_status VARCHAR2(1) DEFAULT 'Y';
BEGIN
XPI2.XPI2_AR_API_RECEIPT_PKG.generate_receipt_simop(in_receipt_number, in_inv_status, in_kode_cabang, out_status, out_message);
dbms_output.put_line('Generate Status : ' || out_status);
dbms_output.put_line('Message Status : ' || out_message);
END;";
$result = $db_simkeu->query($sql_xpi, $param_xpi);
print_r($result);
$out_status1 = $param_xpi['out_status'];
$out_message = $param_xpi['out_message'];
但是,变量 $out_status1 和 $out_message 始终为空。我认为我在此 php 代码中收听响应的方法有问题。请帮忙
感谢您的回答。