Hi,

I am seeking documentation and advice on handling errors when using the 
FirebirdClient-2.0.1 driver (against Firebird 1.5.3 database).

Upon executing a bit of invalid SQL, an FbException is returned.  It 
contains a collection of FbErrors.

For example on executing 'Select rubbish;' I receive the following:

FbException:
    Dynamic SQL Error
    SQL error code = -104
    Unexpected end of command

FbError[0]:
    Class:     0
    LineNumber: 0
    Message:  
    Number:    335544569

FbError[1]:
    Class:     0
    LineNumber: 0
    Message:  
    Number:    335544436

FbError[2]:
    Class:     0
    LineNumber: 0
    Message:  
    Number:    -104

FbError[3]:
    Class:     0
    LineNumber: 0
    Message:  
    Number:    335544608

FbError[4]:
    Class:     0
    LineNumber: 0
    Message:   Dynamic SQL Error\nSQL error code = -104\nUnexpected end 
of command
    Number:    335544569

The most useful error number appears to be the -104 in FbError[2] (in 
this case).  The number and details of the errors vary for different 
types of SQL problems. -204 for a 'Select' on an incorrect table name,  
-607 for 'Drop' of a table that does not exist etc.

I have a document "Firebird 1.5 Error Codes" that appears to match the 
negative error numbers and also shows corresponding 'GDSCODE' numbers 
such as 335544569.  It isn't clear to me what the relationship is nor 
whether the negative errors are definitely the most useful.

Is there any information available on what the various errors are?

At the moment I look through the FbErrors and select the number that is 
< 0 and report this plus the Message from the exception to the user.  Is 
this good practice?  My application allows a user to enter SQL to be 
executed and just has to display the resulting data or error.

Thank you in advance,

Paul


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to