ID:               39820
 Comment by:       symphony dot group at yahoo dot com
 Reported By:      alien at mosfasad dot ru
 Status:           No Feedback
 Bug Type:         PDO related
 Operating System: win xp
 PHP Version:      5.2.0
 Assigned To:      wez
 New Comment:

This bug is still exists in both PHP versions (5.2.12 & 5.3.1)

I've set up two test VMs and am quite willing to help get this working.


the following simple code easily re-produces the bug:

try {
                $dbConn = new PDO('oci:dbname=.....);
                $dbConn->setAttribute(PDO::ATTR_ERRMODE,
PDO::ERRMODE_EXCEPTION);
                $sql = $dbConn->prepare("
                                BEGIN
                                        SELECT  username
                                        INTO    :chkId
                                        FROM    USERS
                                        WHERE   username = 'fred';
                                END;
                                ");
                $sql->bindParam('chkId', $chkId);
                $sql->execute();
                var_dump($chkId);
        } catch (Exception $e) {
                var_dump($e);
        }

obviously I've censored our connection info.

as the other user mentioned if I alter the bindParam to:

$sql->bindParam('chkId', $chkId, PDO::PARAM_STR, 10);

it works. however even missing off the variable length causes a error


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

[2009-05-03 01:00:02] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

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

[2009-04-25 14:40:57] [email protected]

Please try using this CVS snapshot:

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

  http://windows.php.net/snapshots/



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

[2007-01-09 15:59:17] alien at mosfasad dot ru

i can temporary resolve this problem by this code:

$sSql =  'call ReportOrder( :out0, :var0 , :var1)';
$sOut = '                    ';
$sVar0 = null;

$aArguments = Array ('var0' =>'asdasasdasd','var1' =>'3242424' );

$sDsn = 'oci:dbname=********';
$sUser = '***';
$sPass  = '*******';
$aArgs = array();

$oPDOs = new PDO($sDsn,$sUser,$sPass,$aArgs);

$oStat = $oPDOs->prepare( $sSql );
$oStat->bindParam('out0', $sOut, PDO::PARAM_STR,strlen( $sOut ) );
/* !!!!!! this CODE  !!!!*/
$oStat->bindParam('var0',$sVar0 );
$oStat->bindParam('var1',$sVar0 );
/* !!!!!!********!!!!*/
$oStat->execute($aArguments);
echo '['.$sOut.']';
?>

PLSQL PROC :

CREATE OR REPLACE PROCEDURE ReportOrder
(
        dCalcId OUT VARCHAR2, dFormId VARCHAR2, dFormId1 VARCHAR2
) IS
BEGIN
        dCalcId := dFormId || dFormId1;
END;

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

[2007-01-09 15:10:15] alien at mosfasad dot ru

!!! WRONG !!! :
/* !!! IF COMMENT LINE BELOW, NO ERROR */
$oPDOs->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
/**/
if i comment this lines error i can look error, when i call method
errorInfo( )!

print_r( $oStat->errorInfo( ) );

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

[2006-12-25 12:12:48] alien at mosfasad dot ru

$sSql =  'call ReportOrder(:var0,:out0,:var1,:var2,:var3)';

CREATE OR REPLACE PROCEDURE ReportOrder
(
        dFormId NUMBER, dCalcId OUT VARCHAR2, sUnionDescr VARCHAR2, sArgsName
VARCHAR2, sColsName VARCHAR2
) IS
BEGIN
        dCalcId := '1';
END;

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/39820

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

Reply via email to