|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-06-22 05:02 UTC] m dot sijmons at nibble dot nl
Description:
------------
Executing a database procedure gives errors.
Database procedures with or without parameters, gives problems
Reproduce code:
---------------
CREATE PROCEDURE p_proc_noparam
result row (integer, integer, varchar(256), char(1), integer, integer) AS
DECLARE
RetOK integer NOT NULL WITH DEFAULT; /* return status OK */
dbError integer NOT NULL WITH DEFAULT; /* return status Error */
dbErrortext varchar(256) NOT NULL WITH DEFAULT;
dbSeverity char(1) NOT NULL WITH DEFAULT;
dbRowcount integer NOT NULL WITH DEFAULT;
id integer NOT NULL WITH DEFAULT;
BEGIN
RetOK = 1;
dbError = 0;
dbErrortext = 'No error';
dbSeverity = 'S';
dbRowcount = 0;
id = 1045;
RETURN row (:RetOK,:dbError,:dbErrortext,:dbSeverity,:dbRowcount, :id);
END;
<?php
$database="databasename";
$user="username";
$password="dummy";
$link = ingres_connect($database, $user, $password);
$result = ingres_query($link, "execute procedure p_proc_noparam");
if ( ingres_errno() != 0 )
{
$error_text = ingres_error();
echo($error_text);
}
else
{
$dbRow = ingres_fetch_row($result);
echo "return value - " . ingres_fetch_proc_return($result) . "</BR>";
print_r($dbRow);
}
ingres_close($link);
?>
Expected result:
----------------
Succesful execution and a result row with some status
information that can be fetched.
Actual result:
--------------
Warning: ingres_query() [function.ingres-query]: Unable to execute OpenAPI query type, 8 in F:\applications\xampp\htdocs\phpMVC\test_html\ingres_test1.php on line 9
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 18:00:02 2025 UTC |
this is the complete patch, also prevents procedures from being "described": Index: ingres.c =================================================================== RCS file: /repository/pecl/ingres/ingres.c,v retrieving revision 1.28 diff -u -w -r1.28 ingres.c --- ingres.c 18 Jun 2009 17:41:54 -0000 1.28 +++ ingres.c 22 Jun 2009 09:03:12 -0000 @@ -2207,7 +2207,7 @@ #if defined(IIAPI_VERSION_5) else { - if ((ii_link->apiLevel > IIAPI_LEVEL_3) && INGRESG(describe)) + if (((ii_link->apiLevel > IIAPI_LEVEL_3) && INGRESG(describe)) && (ii_result->queryType != IIAPI_QT_EXEC_PROCEDURE)) { /* We can use DESCRIBE INPUT to work out the types that Ingres is expecting */ if (_ii_prepare(ii_result, query TSRMLS_CC) == II_FAIL) @@ -2294,6 +2294,7 @@ case IIAPI_QT_EXEC_PROCEDURE: queryParm.qy_parameters = TRUE; queryParm.qy_queryText = NULL; + break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to execute OpenAPI query type, %d", ii_result->queryType); RETURN_FALSE;