|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-07-28 05:21 UTC] abhargav at in dot ibm dot com
[2010-07-28 08:29 UTC] aaron dot hawley at vtinfo dot com
[2010-07-29 06:20 UTC] abhargav at in dot ibm dot com
[2010-07-29 10:17 UTC] aaron dot hawley at vtinfo dot com
[2010-08-09 10:36 UTC] aaron dot hawley at vtinfo dot com
[2010-12-29 14:36 UTC] michael at vtinfo dot com
[2012-07-23 14:50 UTC] aaron dot hawley at vtinfo dot com
[2015-09-03 13:23 UTC] rangercairns@php.net
-Status: Open
+Status: Not a bug
[2015-09-03 13:23 UTC] rangercairns@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 19 13:00:01 2025 UTC |
Description: ------------ Unable to run a stored procedure with db2_prepare and db2_execute. Get the error: 38501 Trigger program or external routine detected an error. SQLCODE=-443 Attached is the script we are using. It takes 7 parameters, with the first 3 as input and the last 4 as outputs. This stored procedure has been debugged and it succeeds, but nothing is returned to PHP after the warning. We are able to successfully call this stored procedure from Java. We have had success calling from PHP a different stored procedure with 2 parameters in the same library (database) one input and one output, so stored procedures are working otherwise. Occasionally, it will work flawlessly every so often from PHP -- like once a day with a few dozen tests. We also run a stored procedure that "forces the job log" in the operating system, to see if we could get more information. But calling that stored procedure first makes the problematic procedure run correctly. I am using version 1.8.3 that comes with Zend Server 5.0.1 for IBM i. PHP version is 5.3.1. Zend Server is running in v5r4 of the IBM i. Reproduce code: --------------- <?php $params = array('host' => 'host', 'username' => '*******', 'password' => '*******', 'dbname' => '*LOCAL', 'driver_options' => array('i5_lib' => 'VVIP')); $conn = db2_connect('*LOCAL', $params['username'], $params['password'], $params['driver_options']); $p_email = 'aaron.hawley <at> vtinfo.com'; $p_type = 'R'; $p_schema = ''; $p_user = ''; $p_password = ''; $p_num_rows = 0; $stmt = db2_prepare($conn, "CALL Get_DB2_Attributes(?, ?, ?, ?, ?, ?, ?)"); db2_bind_param($stmt, 1, 'p_environment'); db2_bind_param($stmt, 2, 'p_email'); db2_bind_param($stmt, 3, 'p_type'); db2_bind_param($stmt, 4, 'p_schema', DB2_PARAM_OUT); db2_bind_param($stmt, 5, 'p_user', DB2_PARAM_OUT); db2_bind_param($stmt, 6, 'p_password', DB2_PARAM_OUT); db2_bind_param($stmt, 7, 'p_num_rows', DB2_PARAM_OUT); if (!db2_execute($stmt)) { printf("%s\n", db2_stmt_error($stmt)); $err = db2_stmt_errormsg(); die($err . "\n"); } printf("%s %s %s %s %s %d\n", $p_environment, $p_email, $p_type, $p_schema, $p_user, $p_num_rows); Expected result: ---------------- ENVIRONMENT aaron.hawley<at>vtinfo.com R TSCHEMA TUSER 0 Actual result: -------------- PHP Warning: db2_execute(): Statement Execute Failed in db2-call.php on line 30 Trigger program or external routine detected an error. SQLCODE=-443