[PHP5 AdoDB] Correct return value after oracle package function call should be a string and I get a number instead.
| From: | Andrew Raimondi | Date: | Fri, 22 Oct 2010 13:53:11 +0000 |
| Subject: | [PHP5 AdoDB] Correct return value after oracle package function call should be a string and I get a number instead. | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-47417@lists.php.net to get a copy of this message | ||
Hello.
I'm using PHP5 and ADODb(could not find a version number for the life of me, the closest thing I could
find is an "old-changelog.htm" file topping version 3.92.22 well buried in a docs folder).
I have this php code:
/*getTitoloFromID si riferisce alla tabella CONF_RELAZIONI!!!*/
function getTitoloFromID( $anno, $trimestre,$id )
{
$r_titolo = str_pad('', 50,'@');
$params = array(
'p_anno' => $anno,'p_trimestre' => $trimestre,
'p_id' => $id, 'r_titolo' => &$r_titolo); trace( 'Parametri: '); trace( $params ); $sql = "BEGIN :r_titolo := PKG_RELAZIONI.getTitoloFromID(:p_anno,:p_trimestre,:p_id); END;"; $this->Execute($sql, $params); trace( 'Titolo nella chiamata: '.$r_titolo); return $r_titolo; } Backend is Oracle(don't know the version, again don't have a clue where to look for it, but I'm pretty sure it's above 9 because we use constructs that... d'oh! are present from ver 9 on :D). When I check the LOGS table in my db, I see the *correct* result being added. When this value gets to PHP, however, something happens and I receive the value "1"(without quotes) without any apparent reason. The correct value is a string and, again, it gets displayed in the logs table correctly, hence I assume the SQL is correct. I am also sure it does not depend on the params(trimestre means quarter, the first thing I thought was that I could be misplacing parameters or something like that) but that's not the case either. Return value is properly sized because I had already received the "invalid buffer size" error. Other calls use the same "pattern" and they all work beautifully. I am pretty much at loss and would love some help nailing this because I can't seem to wrap my head around it :-) Many thanks for reading this :-) Andrew