Windows + php + oracle PL/SQL = ORA-06550

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello everyone,
I just installed Zend Core 2.5.0 (simply apache + php 5) with oracle instant client. I enabled the oracle extension. Everything works ok, but I ran into one strange problem. I can connect to the oracle server without problems, I can also perform SELECTs,INSERTs, etc. The problems start when I try to execute a PL/SQL script. E.g.
Lets have these 2 oracle tables.

CREATE TABLE TABLE_A
(
  AID    NUMBER,
  ADATA  VARCHAR2(255 BYTE)
)

CREATE TABLE TABLE_B
(
  BID    NUMBER,
  AID    NUMBER,
  BDATA  VARCHAR2(255 BYTE)
)

INSERT INTO TABLE_A (AID) VALUES (0)
INSERT INTO TABLE_B (BID) VALUES (0)

lets try to execute very simple PL/SQL

DECLARE AAID NUMBER;
		BEGIN
		SELECT MAX(AAID)+1 INTO AAID FROM TABLE_A;
		INSERT INTO TABLE_A (
		aid,adata)
		VALUES (
		AAID
		, 'table_a data');
		INSERT INTO TABLE_B (
		bid,
		aid,bdata)
		VALUES (
		(SELECT MAX(bid)+1 FROM TABLE_B)
		,AAID
		, 'table_b data');
		END;

I can execute this script through TOAD or using simple Java script. But if I try to execute this script using the next php on the Zend Core, I get this warning.
Quote:

PHP Warning: oci_execute(): ORA-06550: line 1, column 21:
PLS-00103: Encountered the symbol "" when expecting one of the following:

begin function package pragma procedure subtype type use
<an identifier> <a double-quoted delimited-identifier> form
current cursor in C:\Program Files\Zend\Apache2\htdocs\coreLib\get_event_itm\test.php on line 21



Here is the very simplified code I'm using

<?php
error_reporting ( E_ALL );
$link = oci_connect("USER","PASSWORD","HOST");
$query = "DECLARE AAID NUMBER;
		BEGIN
		SELECT MAX(AAID)+1 INTO AAID FROM TABLE_A;
		INSERT INTO TABLE_A (
		aid,adata)
		VALUES (
		AAID
		, 'table_a data');
		INSERT INTO TABLE_B (
		bid,
		aid,bdata)
		VALUES (
		(SELECT MAX(bid)+1 FROM TABLE_B)
		,AAID
		, 'table_b data');
		END;";
$result = oci_parse ( $link, $query );
$status = oci_execute ( $result );
?>

Note: When I deployed this script onto the production server, running php5 on RH4, it finnished without problems. To be honest, I don't even have an idea where the problem can be. I would be very thankful for any suggestions.
thank you
Martin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux