ID:               32741
 Updated by:       [EMAIL PROTECTED]
 Reported By:      fsurleau at skyservices dot net
-Status:           Open
+Status:           Feedback
 Bug Type:         OCI8 related
 Operating System: linux
 PHP Version:      4.3.11
 New Comment:

What does it mean "no result"? Segfault? FALSE? Empty string? Zero?
There is _always_ a result, whatever you do.


Previous Comments:
------------------------------------------------------------------------

[2005-04-18 13:22:43] fsurleau at skyservices dot net

Sorry (again, see bug #32722), I can't use PHP5.

------------------------------------------------------------------------

[2005-04-18 13:16:40] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip



------------------------------------------------------------------------

[2005-04-18 13:13:49] fsurleau at skyservices dot net

Reproduce Code is :

$cnx = ociplogon( USER_INTER, PASS_INTER, BD_INTER );
$sql = "BEGIN\nTEST.TEST_COLLECTION( :outparam );\nEND;";
$stmt = ociparse( $cnx, $sql );
$outparam = ocinewcollection( $cnx, "COLLECTION_TYPE" );
ocibindbyname( $stmt, ":outparam", &$outparam, -1, OCI_B_SQLT_NTY );
ociexecute( $stmt );
for( $i = 0; $i < $outparam->size(); $i++ )
{
    echo( "outparam[$i] = '" . $outparam->getelem( $i ) . "'<br>\n" );
}
$sql = "BEGIN\nTEST.TEST_VARCHAR( :outvarchar );\nEND;";
$stmt = ociparse( $cnx, $sql );
$outvarchar = '';
ocibindbyname( $stmt, ":outvarchar", &$outvarchar, 300 );
ociexecute( $stmt );
echo( "outvarchar = '" . $outvarchar . "'<br>\n" );


It was cut at first post...

------------------------------------------------------------------------

[2005-04-18 13:10:24] fsurleau at skyservices dot net

Description:
------------
PHP Version 4.3.11

System  Linux dev1 2.4.9-e.48smp #1 SMP Fri Jul 30 18:52:05 EDT 2004
i686
Build Date      Apr 17 2005 16:44:16
Configure Command       './configure'
'--with-apxs2=/usr/local/apache2/bin/apxs' '--with-zlib-dir=/usr/local'
'--without-mysql' '--with-dom=/usr/local' '--with-dom-xslt'
'--with-dom-exslt' '--with-expat-dir=/usr/local' '--enable-xslt'
'--with-xslt-sablot' '--with-iconv-dir' '--with-zlib=/usr/local'
'--with-oci8=/usr/local/oracle10g' '--disable-rpath' '--with-iconv'
'--with-gd' '--enable-sigchild'
Server API      Apache 2.0 Handler

Can't call an Oracle procedure returning collections with Oracle10g
OCI8 lib.
A simple call to TEST_VARCHAR works (the result is outvarchar =
'VARCHAR VALUE'), and the entire code works when using Oracle9i OCI8
lib.

With Oracle10g, the result is a hang of the httpd process at
ociexecute( $stmt ).

Oracle code :
-------------
CREATE OR REPLACE TYPE "COLLECTION_TYPE" AS TABLE OF VARCHAR2(255);
/

CREATE OR REPLACE PACKAGE TEST AS
        PROCEDURE TEST_COLLECTION( OUTPARAM OUT COLLECTION_TYPE );
        PROCEDURE TEST_VARCHAR( OUTPARAM OUT VARCHAR2 );
END;
/

CREATE OR REPLACE PACKAGE BODY TEST AS
        PROCEDURE TEST_COLLECTION( OUTPARAM OUT COLLECTION_TYPE ) IS
        BEGIN
                OUTPARAM := COLLECTION_TYPE( 'FIRST VALUE', 'SECOND VALUE', 
'THIRD
VALUE' );
        END;
        PROCEDURE TEST_VARCHAR( OUTPARAM OUT VARCHAR2 ) IS
        BEGIN
                OUTPARAM := 'VARCHAR VALUE';
        END;
END;
/

Reproduce code:
---------------
<?php
$cnx = ociplogon( USER_INTER, PASS_INTER, BD_INTER );
$sql = "BEGIN\nTEST.TEST_COLLECTION( :outparam );\nEND;";
$stmt = ociparse( $cnx, $sql );
$outparam = ocinewcollection( $cnx, "COLLECTION_TYPE" );
ocibindbyname( $stmt, ":outparam", &$outparam, -1, OCI_B_SQLT_NTY );
ociexecute( $stmt );
for( $i = 0; $i < $outparam->size(); $i++ )
{
    echo( "outparam[$i] = '" . $outparam->getelem( $i ) . "'<br>\n" );
}
$sql = "BEGIN\nTEST.TEST_VARCHAR( :outvarchar );\nEND;";
$stmt = ociparse( $cnx, $sql );
$outvarchar = '';
ocibindbyname( $stmt, ":outvarchar", &$outvarchar, 300 );
ociexecute( $stmt );
echo( "outvarchar = '" . $outvarchar . "'<br>\n" );
?>

Expected result:
----------------
outparam[0] = 'FIRST VALUE'
outparam[1] = 'SECOND VALUE'
outparam[2] = 'THIRD VALUE'
outvarchar = 'VARCHAR VALUE'

Actual result:
--------------
no result !


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=32741&edit=1

Reply via email to