[unixODBC-dev] SQL error code/status for DBMS unavailability

anand.vasudevan at wipro.com anand.vasudevan at wipro.com
Mon Jan 16 11:31:26 GMT 2006


Hi

Is there a specific error code or sql status which could be checked for
in the application, when SQLConnect fails because the DBMS itself is not
available or not running.

Currently, in my application when I get the diagnostic information using
SQLGetDiagRec.

I get the following SQL_STATE for Ingres: -

[unixODBC][CA][Ingres ODBC Driver][Ingres]Unable to connect to Name
Server: Blank or incorrect Name
SQL STATE IS 08004

For Oracle: -

SQL STATE IS 08001
ODBC error message is [unixODBC][Easysoft][Oracle]ORA-12541: TNS:no
listener

But the same value of SQL_STATE is returned if the username or password
is wrong for Ingres and Oracle databases.

SQL STATE IS 08001
ODBC error message is [unixODBC][Easysoft][Oracle]ORA-12154: TNS:could
not resolve the connect identifier specified

SQL STATE IS 08004
ODBC error message is [unixODBC][CA][Ingres ODBC Driver][Ingres]Remote
login failure: invalid password/userid. If using i


So it is not possible to check if the DBMS is running or not based
SQL_STATE values in the application.

Thanks in advance.

Regards
Anand


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com




More information about the unixODBC-dev mailing list