#18057 [Com]: I can't receive value from Stroed Procedure
| From: | greg at tssolutions dot com dot au | Date: | Tue, 08 Apr 2003 00:01:23 +0000 |
| Subject: | #18057 [Com]: I can't receive value from Stroed Procedure | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-37316@lists.php.net to get a copy of this message | ||
ID: 18057
Comment by: greg at tssolutions dot com dot au
Reported By: smg at hktl dot com
Status: Closed
Bug Type: ODBC related
Operating System: Windows 98/ME/200,Linux
PHP Version: 4.2.1
New Comment:
Ok, I'll bit.
Sorry kalowsky@php.net ODBCv2 does!!! with with procedures.
If you look through this database for odbc_execute there are a number
of issue mentioned, all to do with accessing stored procedures.
It may be that stored procedures in DB2/400 dont work, dont know.
But they should for SQLserver, and they should work for both input and
OUTPUT parameters. Clearly the ODBC imlementation for PHP does not
work when calling a strored procedure when using parameters, thus it is
bug.
The call syntax (for SQLserver0 can be
"{ call x ( ? )}"
or
"exec x ?"
And the paramter should be able to be input/output or both, not just
input.
My question then is, what is the correct process to get this
functionality fixed, it is already in the bugs database and well....
With the mssql functions, may be that code could be used within the
ODBC code base to solve the problems. It may also be the reason why
the number of complaints re this have dropped.
So next time someone has a ODBC issue with stored procedures, just tell
the the truth, PHP implementation is buggy, but they can use mssql or
something else... 8-)))
gt
ex Digit with 20 years of Rdb
Previous Comments:
------------------------------------------------------------------------
[2002-07-23 11:37:21] kalowsky@php.net
ODBCv2 does not work with procedures, sorry. Please read the MS ODBC
specification for more information regarding this at
http://www.microsoft.com/data/odbc
------------------------------------------------------------------------
[2002-07-15 08:11:39] erik at ableson dot homeip dot net
I have something similar which I've distilled to a simpler problem with
the DB2/ODBC drivers although my DB2 instance is running on an AS400 as
well, so it may be part of the problem.
Basically, I cannot retrieve any data from DB2. It properly connects,
issues the query but consistently returns 0 rows. Forcing a bad
password correctly returns an authentication error and creating an
invalid SQL query correctly returns an error as well. From the amount
of time required to return the page, it appears to be issuing the query
and waiting on the response. Complex ugly queries take a long time to
process but always result in zero rows returned.
Code sample used to force at least a one row return which returns 1
field, 0 rows:
<?php
$dbconn = odbc_connect ( "DSN", "USER", "PASSWORD");
echo "Connected to: $dbconn<br>";
$sqlresult = odbc_exec( $dbconn, "SELECT COUNT(*) AS TOTAL FROM
RU99.RC545 WHERE SIGNONID='L6XJ'");
echo $sqlresult . "<BR>";
echo "Fields: " . odbc_num_fields ($sqlresult);
echo " Rows: " . odbc_num_rows ($sqlresult);
odbc_close($dbconn);
?>
------------------------------------------------------------------------
[2002-06-28 21:59:40] smg at hktl dot com
Hi.
first, my english is not good but I believe you are understand about
my
english.
I can't receive return value from DB2/400 Stroed Procedure. next
source
<?
$db_conn=odbc_connect("DSNBSN400","WEBUSER","WEBUSER") or die (
odbc_error
() );
$result=odbc_prepare($db_conn,"Call WEBLIB.TEST_SP01(?,?)");
$par[0]=11;$par[1]='';
if(!odbc_execute($result,&$par))
{
print("The odbc statement failed to execute! ");
}
print_r($par);
?>
I want to receive Return Value.
good job
bye
ps : I using to IBM AS/400 DB2 UDB
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18057&edit=1