Re: DB errorNative() method

From: Date: Wed, 07 Jan 2004 13:39:49 +0000
Subject: Re: DB errorNative() method
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-24846@lists.php.net to get a copy of this message
On Tue, 6 Jan 2004, Daniel Convissor wrote: > I've run into an odd situation. mssql didn't have an errorNative() > method. It seems most errorNative() methods return an error code from the > backend. But, some produce an error message (sybase, pgsql). Worse, a > couple produce a string containing both the code and the message (odbc, > ifx). > > For the new mssql procedure, I'm thinking it would be best for it to > return the numeric error code because it can, even though sybase comes > back with a text message. I think the mysql driver is a good reference driver. It uses numeric error code which also makes it easier to map native error codes againts pear error codes. With some driver (such as postgres and sqlite) which natively do not return numeric error codes you have to play around with regexps to map error messages with pear error codes. -- Mika Tuupola http://www.appelsiini.net/~tuupola/

« previous php.pear.dev (#24846) next »