Reply to ORACLE Error

Your name:

Reply:


Posted by alex on 06/22/07 11:20

I'm executing this code against an Oracle connection. The SQL works
perfectly under an ORACLE console, but fails when executing it from the
PHP script. I hope someone can give me a guiding light here, as i cant
find where its wrong.

<pre><?php
$conn=oci_new_connect("xxx","xxx","XXXXX");
echo "<br>TEST connect XXXXX: "; var_dump ($conn);

$sql = <<<SQLEND
DECLARE
RetVal NUMBER;
DIA DATE;
MZ NUMBER;
Z NUMBER;
BEGIN
DIA := to_date('2017-06-22 10:38:00','YYYY-MM-DD HH24:MI:SS');
MZ := 3;
Z := 1;
RetVal := TAXITRONIC.CALCULA_ESPERA (DIA, MZ, Z );

END;
SQLEND;

$stmt=oci_parse($conn,$sql);
echo "<br>STMT: "; var_dump ($stmt);

oci_bind_by_name($stmt,":RetVal",$momentoAnulacion,32);
$rs=oci_execute($stmt);
echo "<br>RS: "; var_dump ($RS);
echo "<br>OCI ERROR: "; var_dump (oci_error($stmt));

oci_close($conn);
?></pre>



Here i paste the output with the error code (which translates from
spanish as "The symbol "" has been found when it was expected any of the
following":


TEST connect XXXXX: resource(13) of type (oci8 connection)

STMT: resource(14) of type (oci8 statement)

RS: NULL

OCI ERROR: array(4) {
["code"]=>
int(6550)
["message"]=>
string(256) "ORA-06550: línea 1, columna 8:
PLS-00103: Se ha encontrado el símbolo "" cuando se esperaba uno de los
siguientes:

begin function package pragma procedure subtype type use
form
current cursor"
["offset"]=>
int(7)
["sqltext"]=>
string(271) "DECLARE
RetVal NUMBER;
DIA DATE;
MZ NUMBER;
Z NUMBER;
BEGIN
DIA := to_date('2017-06-22 10:38:00','YYYY-MM-DD HH24:MI:SS');
MZ := 3;
Z := 1;
RetVal := TAXITRONIC.CALCULA_ESPERA (DIA, MZ, Z );

END;"
}

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация