Re: [PHP4BETA] Stored Procedures (via ODBC)
| From: | Leo Baschy | Date: | Fri, 17 Mar 2000 16:10:58 +0000 |
| Subject: | Re: [PHP4BETA] Stored Procedures (via ODBC) | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-12334@lists.php.net to get a copy of this message | ||
Your odbc_exec() I'd say is missing a parameters array for the ?. Maybe you got it right in
your code and just pasted the wrong example, but I mention it to make sure. Either don't use ?
for your test, or if it you need ? then after odbc_prepare() call odbc_execute() with a parameters
array with one element in it for each ?.
Also did you try for the query string the ODBC syntax for procedure calls that goes like this:
"{CALL knowone.test.writereturn(?)}"
Note those curly brackets.
If that's not it, there could be aforementioned problems that are PHP specific (but should be
fixed soon for everyone, as mentioned I'll need my fix reviewed) with the order of long text
columns between other columns. For now long text and binaries must all be at the end, the last
columns, to work correctly. Any long text columns expected in your resulting row? Try a SELECT
with the same kind of row as result. Is that arriving well?
To further explore if it still does not work: What does PHP tell you the number of columns is,
their names, their types, do the answers you get for those calls make sense to you?
- Leo Baschy <nirvana@got.net>
At 04:36 PM 3/17/00 +0100, you wrote:
hi,
we try to call an ADABAS-D stored procedure like this:
$res=odbc_exec($db,"proc knowone.test.writereturn(?)");
(also tried the following one:
$res=odbc_prepare($db,"proc knowone.test.writereturn(?)");
$res=odbc_execute($res,$x);
)
the procedure is executed. after that we can read:
$rows = odbc_num_rows($res);
echo $rows;
.. returns 1. That is: $res is a valid resultset and
there is a result.
but:
odbc_result(),
odbc_fetch_row() and
odbc_fetch_into()
...throw the error message:
Warning: No tuples available at this result index in ...
any idea?
regards,
gaylord aulke
agi. stuttgart,germany