Re: [Sqlrelay-discussion] Error Codes form SQLRelay into PHP
Brought to you by:
mused
|
From: David M. <dav...@fi...> - 2006-08-15 02:30:57
|
Aaah, just noticed this message in my crowded inbox.
It's tricky for SQL Relay to report anything but DB_ERROR. The Pear DB
driver would have to parse all of the possible error strings that SQL
Relay can return and set the proper code for each. A good solution
would be for SQL Relay to define a set of error codes and have each SQL
Relay connection translate the database error codes to SQL Relay's
codes, and return the SQL Relay error code in addition to the native
code and string. Then the Pear DB driver could translate the SQL Relay
error code to a Pear DB error code.
It'd be a bit of work to do that though, it probably won't be in the
next release :)
In the mean time, the error string should be in there, the Pear DB
driver calls:
$error = sqlrcur_errorMessage($sqlrcursor->cursor);
return $this->raiseError(DB_ERROR, null, null, null,
$error);
whenever an error occurs so your app could potentially parse it, though
that's not a great solution.
Dave
dav...@fi...
On Tue, 2006-08-01 at 22:29 -0400, Dave Sugar wrote:
> Hi,
>
> I have been doing some repurposing of some PHP code to use SQLRelay
> instead of the PEAR oci8 interface. And all is generally pretty
> good, but I have noticed some cases were we are checking for specific
> error conditions returned from the database and those conditions are
> not being met when using SQLRelay.
>
> An example of this is a case where we perform an insert and expect
> that we might get back the error DB_ERROR_ALREADY_EXISTS if the
> insert fails because the row already exists. But SQLRelay doesn't
> seem to care what the error is, it just returns the generic error
> DB_ERROR. Is there a way to get SQLRelay to know more information
> about the error that has been returned?
>
> We are using SQLRelay 0.37 which I believe is the latest.
>
> Thanks
> Dave Sugar
> dsu...@co...
>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Sqlrelay-discussion mailing list
> Sql...@li...
> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion
>
|