php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67278 db2-bind-param with an INOUT Param does not work
Submitted: 2014-05-14 15:19 UTC Modified: 2015-06-05 12:27 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:0 of 0 (0.0%)
From: agitheking at gmail dot com Assigned: rahulpriyadarshi (profile)
Status: Closed Package: ibm_db2 (PECL)
PHP Version: 5.4.28 OS: RHEL 6.5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
25 + 17 = ?
Subscribe to this entry?

 
 [2014-05-14 15:19 UTC] agitheking at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.db2-bind-param
---
Problems with the db2_bin_param():

$rc=db2_bind_param($stmt, 4, "MESSAGE", DB2_PARAM_IN);print_r ($rc); works fine!
$rc=db2_bind_param($stmt, 4, "MESSAGE", DB2_PARAM_OUT);print_r ($rc);works fine!
$rc=db2_bind_param($stmt, 4, "MESSAGE", DB2_PARAM_INOUT);print_r ($rc); does not work!

the Message param is a xml.
Error Message: string '[IBM][CLI Driver][DB2] SQL0462W  Command or routine "ACCEL_CONTROL_ACCELERATOR" (specific name "ACCEL_CONTROL_ACCELERATOR") has returned a warning SQLSTATE, with diagnostic text "AQT10402I DETAILS ".  SQLSTATE=01H08'

Test script:
---------------
$sql = 'CALL SYSPROC.ACCEL_CONTROL_ACCELERATOR(?,?,?,?)';
$stmt=db2_prepare($conn, $sql);

$ACCELERATOR_NAME = $accelname;
$COMMAND = $command;
$RESULT="";

$clob = "<?xml version='1.0' encoding='UTF-8' ?>\n";
$clob .="<spctrl:messageControl xmlns:spctrl='http://www.ibm.com/xmlns/prod/dwa/2011' version='1.0' versionOnly='true'>\n";
$clob .=  "</spctrl:messageControl>";

$MESSAGE= $clob;

$rc=db2_bind_param($stmt, 1, "ACCELERATOR_NAME", DB2_PARAM_IN);print_r ($rc);
$rc=db2_bind_param($stmt, 2 ,"COMMAND"  , DB2_PARAM_IN);print_r ($rc);
$rc=db2_bind_param($stmt, 3, "RESULT", DB2_PARAM_OUT);print_r ($rc);
$rc=db2_bind_param($stmt, 4, "MESSAGE", DB2_PARAM_INOUT);print_r ($rc);

db2_execute($stmt);


Patches

patch_04Jun2014 (last revision 2014-06-04 11:30 UTC by rahulpriyadarshi@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-05-15 14:16 UTC] agitheking at gmail dot com
Also tried with:

$rc=db2_bind_param($stmt, 4, "MESSAGE", DB2_PARAM_INOUT, DB2_XML);print_r ($rc);
 [2014-05-21 14:36 UTC] agitheking at gmail dot com
I installed the ibm_db2 PECL with the following make test Test Result:
=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :    0
Exts tested     :   30
---------------------------------------------------------------------

Number of tests :  215                 2
Tests skipped   :  213 ( 99.1%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    2 (  0.9%) (100.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :    0 (  0.0%) (  0.0%)
---------------------------------------------------------------------
Time taken      :    6 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
IBM-DB2: Call a stored procedure in a different binding pattern [tests/test_148_CallSPDiffBindPattern_01.phpt]
IBM-DB2: check for connect deallocator functioning to rollback and disconnect if there is any active transaction [tests/test_connect_deallocator.phpt]
=====================================================================
 [2014-06-04 11:30 UTC] rahulpriyadarshi@php.net
The following patch has been added/updated:

Patch Name: patch_04Jun2014
Revision:   1401881452
URL:        https://bugs.php.net/patch-display.php?bug=67278&patch=patch_04Jun2014&revision=1401881452
 [2014-06-04 11:31 UTC] rahulpriyadarshi@php.net
-Status: Open +Status: Assigned
 [2014-06-04 11:33 UTC] rahulpriyadarshi@php.net
-Assigned To: +Assigned To: rahulpriyadarshi
 [2014-06-04 11:33 UTC] rahulpriyadarshi@php.net
Thanks for reporting this issue, I have created a patch for this and attached the patch with this issue.
 [2015-06-05 12:27 UTC] rahulpriyadarshi@php.net
-Status: Assigned +Status: Closed
 [2015-06-05 12:27 UTC] rahulpriyadarshi@php.net
The changes are released with ibm_db2-1.9.6
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC