1
PHP 엔진 v5.1 및 Oracle OCI를 사용하여 PHP 스크립트에서 저장된 oracle 함수를 실행하려고합니다. PHP 용 확장 모듈. 그리고 그 목적을 위해 나는 pk member_id와 product_id를 가져올이 함수를 실행하는데 사용될 2 plsql 블록을 가지고있다. 이 과정에서, 나는 다음과 같은 오류를ORA-06550 : 행 15, 열 7 : nPLS-00103 : 기호가 있습니다. " BEGIN "
ORA-06550를 점점 오전 : 15 행, 열 7 : \ 부실 채권-00103 : 발생했습니다 기호가 " 나는 확실하지 않다 방법 "
BEGIN 이 오류를 해결 하시겠습니까?
<?php
$conn = oci_connect("username","password","localdb");
$CONFIG_NAME='DirectType';
$BUS_SEG_CODE='';
$PRODUCT_NUM='130342';
$MEMBER_NAME='87307-3';
$EFFECTIVE_DATE=strtotime('2016-12-01');
$MODEL_DATE=time();
$CURRENCY='USD';
$REALM_NUM=1024;
$RESOLVED_PRICE=111;
$RESOLVED_CURRENCY='USD';
if ($conn) {
echo "Connection Successful"."\n";
echo "System time is ".time();
$sql_proc = "
DECLARE
v_MEMBER_ID NUMBER;
v_PRODUCT_ID NUMBER;
BEGIN
SELECT cat_map_id INTO v_PRODUCT_ID
FROM mn_cat_map WHERE product_num = :PRODUCT_NUM and catalog_type = 'INT';
EXCEPTION
WHEN NO_DATA_FOUND THEN
dbms_output.put_line('Product Error');
return;
END;
BEGIN
SELECT member_id INTO v_MEMBER_ID
FROM mn_member WHERE member_name = :MEMBER_NAME;
EXCEPTION
WHEN NO_DATA_FOUND THEN
dbms_output.put_line('Customer Error');
return;
END;
BEGIN PACKAGE_NAME.function_name(
:CONFIG_NAME,
:BUS_SEG_CODE,
v_MEMBER_ID,
v_PRODUCT_ID,
:EFFECTIVE_DATE,
:MODEL_DATE,
:CURRENCY_CODE,
:REALM_NUM,
:RESOLVED_PRICE,
:RESOLVED_CURRENCY
);
END;
";
$stmt = oci_parse($conn,$sql_proc);
// Bind the input parameter
oci_bind_by_name($stmt,':CONFIG_NAME',$CONFIG_NAME);
oci_bind_by_name($stmt,':BUS_SEG_CODE',$BUS_SEG_CODE);
oci_bind_by_name($stmt,':EFFECTIVE_DATE',$EFFECTIVE_DATE);
oci_bind_by_name($stmt,':MODEL_DATE',$MODEL_DATE);
oci_bind_by_name($stmt,':CURRENCY_CODE',$CURRENCY);
oci_bind_by_name($stmt,':REALM_NUM',$REALM_NUM);
oci_bind_by_name($stmt,':RESOLVED_PRICE',$RESOLVED_PRICE);
oci_bind_by_name($stmt,':RESOLVED_CURRENCY',$RESOLVED_CURRENCY);
// Parse the statement. Note there is no final semi-colon in the SQL statement
$result=oci_execute($stmt);
if (!$result){
$e = oci_error($stmt); // For oci_execute errors pass the statement handle
print htmlentities($e['message']);
print "\n<pre>\n";
print htmlentities($e['sqltext']);
printf("\n%".($e['offset']+1)."s", "^");
print "\n</pre>\n";
}
else {
echo "Execute STMT returns True or False : ".$result;
echo "Resolved Price is : ".$RESOLVED_PRICE. "\n";
}
echo "</pre>";
oci_free_statement($stmt);
oci_close($conn);
}
else {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
?>