2016-12-11 6 views
0

ich die folgende Fehlermeldung erhalten, wenn ich versuchte, GET_Card_TRANS Prozedur auszuführen:oracle php OCI prcedure fehlgeschlagen

[code] => 6550 

[message] => ORA-06550: line 6, column 21: 
PLS-00103: Encountered the symbol "" when expecting one of the following: 

    . () , * @ % & = - + </> at in is mod remainder not rem => 
<an exponent (**)> <> or != or ~= >= <= <> and or like like2 
    like4 likec between || indicator multiset member submultiset 

[offset] => 155 

[sqltext] => BEGIN 
      WEB_SHOW.GET_Card_TRANS(
       :User_Id, 
       :Pswd, 
       :vcard_id 
       :sdate 
       :EDATE 
       :Vcond 
       :CARD_TRANS_data 
      ); 
     END; 

Dies ist der PHP-Code:

<?php 

// Connect to database 
$conn = oci_connect("xxx", "yyy", "aaaa:bb/cc", 'dd'); 

if (!$conn) { 
    $e = oci_error($conn); 
    print_r($e); 
    exit ("Connection failed."); 
} 

$user_id = 'demo'; 
$password = 'password'; 
$vcard_id = '1-0'; 
$start_date = '01-01-2016'; 
$end_date = '01-01-2016'; 
$condition = '1'; 

$sql = "BEGIN 
      web_show.GET_Card_TRANS(
       :User_Id, 
       :Pswd, 
       :vcard_id 
       :sdate 
       :EDATE 
       :Vcond 
       :CARD_TRANS_data 
      ); 
     END;"; 

$stmt = oci_parse($conn, $sql); 

oci_bind_by_name($stmt, ':User_Id', $user_id ); 
oci_bind_by_name($stmt, ':Pswd',  $password ); 
oci_bind_by_name($stmt, ':vcard_id', $vcard_id ); 
oci_bind_by_name($stmt, ':sdate', $start_date); 
oci_bind_by_name($stmt, ':EDATE', $end_date ); 
oci_bind_by_name($stmt, ':Vcond', $condition ); 

// Create a new cursor resource 
$curs = oci_new_cursor($conn); 

// Bind the cursor resource to the Oracle argument 
oci_bind_by_name($stmt,":CARD_TRANS_data",$curs,-1,OCI_B_CURSOR); 


if (!oci_execute($stmt)) { 
    $e = oci_error($stmt); 
    print_r($e); 
    exit("Procedure Failed."); 
} 

// Execute the cursor 
if (!oci_execute($curs, OCI_DEFAULT)) { 
    $e = oci_error($curs); 
    print_r($e); 
    exit("Execute cursor Failed."); 
} 

while (($row = oci_fetch_array($curs, OCI_ASSOC+OCI_RETURN_NULLS)) != false) { 
    print_r($row); 
    //echo $row['FIRST_NAME'] . "<br />\n"; 
} 

oci_free_statement($stmt); 
oci_free_statement($curs); 
oci_close($conn); 

?> 
+0

scheint, wie Sie einen Fehler in der Prozedur haben, können Sie weitere Informationen zur Verfügung stellen? –

+0

Bitte Code von 'GET_Card_TRANS' anzeigen – Kacper

+0

Schwierig zu sagen ohne GET_Card_TRANS Code, aber Sie könnten irgendwo einige Parens oder Semikolon fehlen –

Antwort

1

Fehlende Kommas, vielleicht?

Dieses:

$sql = "BEGIN 
      web_show.GET_Card_TRANS(
       :User_Id, 
       :Pswd, 
       :vcard_id 
       :sdate 
       :EDATE 
       :Vcond 
       :CARD_TRANS_data 
      ); 
     END;" 

;

sollte stattdessen sein:

$sql = "BEGIN 
      web_show.GET_Card_TRANS(
       :User_Id, 
       :Pswd, 
       :vcard_id, 
       :sdate, 
       :EDATE, 
       :Vcond, 
       :CARD_TRANS_data 
      ); 
     END;"; 
Verwandte Themen