[PHP] Oracle Execute Function
Hello All, I have this Oracle function, and within my code I call it like this: $sql = BEGIN :result := my_funtion_name('$parm1', $parm2, null, null, null); END;; $stmt = $db-parse($sql); $rc = null; ocibindbyname($stmt, :result, $rc); $db-execute($stmt, $sql); The problem is that the execute function spits back an error/warning message, but the Oracle function properly executes and the data is in the Database. The execute function looks like this: (This function enters the conditional where ii executes the die() function) public function execute($stmt, $query = ) { if( $this-trans) $result = @ociexecute($stmt, OCI_DEFAULT); else $result = @ociexecute($stmt); if (!$result ) { $error = ocierror($this-link); $this-report('Invalid Statement: ' . $stmt .'('.$query.')'. ' ' . htmlentities($error['message'])); die('Invalid Statement: ' . $stmt .'('.$query.')'. ' ' . htmlentities($error['message'])); } return $result; } I use this wrapper class for many things, and the execute function for many things, without any problems. Now, this is an initial run at calling Oracle functions within PHP. Any words of wisdom as to what could be causing this problem, or any other insight? TIA -Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Oracle Execute Function
# [EMAIL PROTECTED] / 2007-01-18 11:46:10 -0500: Hello All, I have this Oracle function, and within my code I call it like this: $sql = BEGIN :result := my_funtion_name('$parm1', $parm2, null, null, null); END;; $stmt = $db-parse($sql); $rc = null; ocibindbyname($stmt, :result, $rc); $db-execute($stmt, $sql); The problem is that the execute function spits back an error/warning message, but the Oracle function properly executes and the data is in the Database. And the warning is...? -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Oracle Execute Function
Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-01-18 11:46:10 -0500: Hello All, I have this Oracle function, and within my code I call it like this: $sql = BEGIN :result := my_funtion_name('$parm1', $parm2, null, null, null); END;; $stmt = $db-parse($sql); $rc = null; ocibindbyname($stmt, :result, $rc); $db-execute($stmt, $sql); The problem is that the execute function spits back an error/warning message, but the Oracle function properly executes and the data is in the Database. And the warning is...? Nothing of real use from what I can see.. It falls into this statement: die('Invalid Statement: ' . $stmt .'('.$query.')'. ' ' . htmlentities($error['message'])); So, I get this message back (and the error['message'] part is blank. It gets there from this: $result = @ociexecute($stmt); if(!$result) { ... } so the return from ociexecute appears to be FALSE. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Oracle Execute Function
Brad Bonkoski wrote: Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-01-18 11:46:10 -0500: Hello All, I have this Oracle function, and within my code I call it like this: $sql = BEGIN :result := my_funtion_name('$parm1', $parm2, null, null, null); END;; $stmt = $db-parse($sql); $rc = null; ocibindbyname($stmt, :result, $rc); $db-execute($stmt, $sql); The problem is that the execute function spits back an error/warning message, but the Oracle function properly executes and the data is in the Database. And the warning is...? Nothing of real use from what I can see.. It falls into this statement: die('Invalid Statement: ' . $stmt .'('.$query.')'. ' ' . htmlentities($error['message'])); So, I get this message back (and the error['message'] part is blank. It gets there from this: $result = @ociexecute($stmt); if(!$result) { ... } so the return from ociexecute appears to be FALSE. After removing the '@' from the ociexecute ... I get this: PL/SQL: numeric or value error: character string buffer too small Does this trigger any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Oracle Execute Function
Brad Bonkoski wrote: Brad Bonkoski wrote: Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-01-18 11:46:10 -0500: Hello All, I have this Oracle function, and within my code I call it like this: $sql = BEGIN :result := my_funtion_name('$parm1', $parm2, null, null, null); END;; $stmt = $db-parse($sql); $rc = null; ocibindbyname($stmt, :result, $rc); $db-execute($stmt, $sql); The problem is that the execute function spits back an error/warning message, but the Oracle function properly executes and the data is in the Database. And the warning is...? Nothing of real use from what I can see.. It falls into this statement: die('Invalid Statement: ' . $stmt .'('.$query.')'. ' ' . htmlentities($error['message'])); So, I get this message back (and the error['message'] part is blank. It gets there from this: $result = @ociexecute($stmt); if(!$result) { ... } so the return from ociexecute appears to be FALSE. After removing the '@' from the ociexecute ... I get this: PL/SQL: numeric or value error: character string buffer too small Does this trigger any ideas? Sounds like an issue with your function. Does it work ok outside of php? -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php