Created
December 18, 2012 09:42
-
-
Save mariuz/4326672 to your computer and use it in GitHub Desktop.
Problem:
If I run a stored procedure which produces an error *internally*, php does *not* report this error in ibase_errmsg, but simply returns an empty result set. For example: create procedure phptest(id integer)
returns (status varchar(100))
as
declare i integer;
begin i = 1/0; status = 'ok'; suspend;
end; call this SP:
select status from php…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
You need to create the procedure this way in flamerobin / isql-fb | |
SET TERM ^ ; | |
create procedure phptest(id integer) | |
returns (status varchar(100)) | |
as | |
declare i integer; | |
begin | |
i = 1/0; | |
status = 'ok'; | |
suspend; | |
end^ | |
SET TERM ; ^ | |
*/ | |
$host = 'localhost:/tmp/test.fdb'; | |
$username ='sysdba'; | |
$password ='masterkey'; | |
$dbh = ibase_connect($host, $username, $password); | |
$stmt = 'select status from phptest(1)'; | |
$sth = ibase_query($dbh, $stmt); | |
while ($row = ibase_fetch_object($sth)) { | |
echo $row; | |
} | |
echo ibase_errmsg(); | |
ibase_free_result($sth); | |
ibase_close($dbh); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment