home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.ingres
- Path: sparky!uunet!enterpoop.mit.edu!bloom-picayune.mit.edu!thomasl
- From: thomasl@mtl.mit.edu (Thomas J Lohman)
- Subject: Ingres error handling
- Message-ID: <1993Jan26.194422.25457@athena.mit.edu>
- Sender: news@athena.mit.edu (News system)
- Nntp-Posting-Host: garcon.mit.edu
- Organization: MIT Microsystems Technology Laboratories
- Date: Tue, 26 Jan 1993 19:44:22 GMT
- Lines: 56
-
- I am having some difficulty unearthing all of the different ways
- you can trap Ingres EQUEL/ESQL errors for the C language.
-
- I will try to summarize my thoughts and would like people to tell me
- how they think it works (I am most likely wrong anyhow).
-
- Ways to capture/get errors in EQUEL
- -----------------------------------
-
- (1) Use the IIseterr function to define an error handler which will be
- called by Ingres if there is an Ingres error.
-
- (2) Issue the inquire_ingres (inquire_equel) command to find out the
- error number and deal with it. This option would have to be used
- in a case by case basis.
-
- Now, my question is, will option (2) suppress msgs going to stdout, unless
- I explicitly tell it to output error messages?
-
- Ways to capture/get errors in ESQL
- -----------------------------------
-
- (1) Declare the SQLCA structure, and check the sqlcode member in a case
- by case basis.
-
- (2) Declare the SQLCA structure and use the "whenever" statement deal with
- warnings, or errors. This also enables you to call your a user
- defined function, and it is only valid for the SQL statements which follow
- it's definition inside the source module.
-
- (3) Define an error trapping routine which can then be set using the
- set_sql command. I think that the SQLCA shouldn't be defined.
-
- (4) You can use the inquire_sql statement to find out the error, although
- it does say this does not suppress messages to the screen.
-
- (5) You can use the IIseterr function, like above.
-
-
- SQL seems to have more variety but the documentation doesn't really
- do a great job of defining what you can do. It seems that under ESQL,
- option (1) should really be used as well as option (2). Option (3)
- seems to the equivalent of (5) which seems to be the equivalent of
- EQUEL's option (1).
-
- I would like to know what I've screwed up in the above ramblings, and
- I'd be interested in knowing how people handle error checking in
- ESQL especially for C.
-
- thanks,
-
-
- --tom
-
-
-
-