php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11550 Cannot return a NULL as out parameter of a stored procedure
Submitted: 2001-06-19 03:58 UTC Modified: 2002-08-13 22:55 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: g dot giunta at libero dot it Assigned:
Status: Not a bug Package: Oracle related
PHP Version: 4.0.4pl1 OS: Windows 95; SCO Openserver 5.0.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:
33 + 32 = ?
Subscribe to this entry?

 
 [2001-06-19 03:58 UTC] g dot giunta at libero dot it
Returning a NULL value as an OUT parameter of a stored procedure (oracle 7.3.4 both client & server) I get the following error from a call to ora_exec: 

ORA-01405: fetched column value is NULL -- 
while processing OCI function OEXEC/OEXN 

I've checked the parameter is correctly bound to a php global variable. 

I tried defining the same parameter both as OUT and IN_OUT, to no avail. 

I also tried calling the same exact procedure using oci_ functions instead of ora_, and everything works! (Unfortunately my web server is sitting on a sco box, so I'm doomed to use oracle 7.3.4 in production...) 

Looking at the description of the error in oracle manuals, I think this could be a pbl in the use of pro*C (well, whatever the php oracle extension is written with), but I might be wrong

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-13 22:55 UTC] kalowsky@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 [2004-06-15 10:31 UTC] mga at nrd dot lt
The same problem with PHP ver. 4.2.2
Deep analysis shows that ora_exec fails when at least one return parameter was null or empty string.
Solution which works:
For example:
I had procedure: getLEInfo(:i_LECode, :o_LEName, :o_LEAddress, :o_AddInfo)
Parameter o_AddInfo value in most case were empty string.
So when I execute query like this "begin getLEInfo(:i_LECode, :o_LEName, :o_LEAddress, :o_AddInfo);end;"
I got ORA-01405.

But the query bellow works without problem:
"declare LEName varchar2(100); LEAddress varchar2(100); AddInfo varchar2(100); begin getLEInfo(:i_LECode, LEName, :o_LEAddress, :o_AddInfo); :o_LEName := nvl(LEName, ' '); :o_LEAddress:= nvl(LEAddress, ' '); :o_AddInfo := nvl(AddInfo, ' '); end;"

Maybe it is too straight solution, but it works.

Marius

P.S. if return value is empty, this solution produces ' ' value, so trim it or just keep in mind :)

Marius
 [2004-06-15 10:33 UTC] mga at nrd dot lt
Sorry, mistake in sql query, there is correct query:
"declare LEName varchar2(100); LEAddress varchar2(100); AddInfo
varchar2(100); begin getLEInfo(:i_LECode, LEName, LEAddress,
AddInfo); :o_LEName := nvl(LEName, ' '); :o_LEAddress:=
nvl(LEAddress, ' '); :o_AddInfo := nvl(AddInfo, ' '); end;"
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Sep 21 16:01:24 2023 UTC