|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-04-18 13:10 UTC] 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 !
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 05:00:01 2025 UTC |
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...