home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / database / ingres / 2362 < prev    next >
Encoding:
Text File  |  1993-01-27  |  2.3 KB  |  68 lines

  1. Newsgroups: comp.databases.ingres
  2. Path: sparky!uunet!enterpoop.mit.edu!bloom-picayune.mit.edu!thomasl
  3. From: thomasl@mtl.mit.edu (Thomas J Lohman)
  4. Subject: Ingres error handling
  5. Message-ID: <1993Jan26.194422.25457@athena.mit.edu>
  6. Sender: news@athena.mit.edu (News system)
  7. Nntp-Posting-Host: garcon.mit.edu
  8. Organization: MIT Microsystems Technology Laboratories
  9. Date: Tue, 26 Jan 1993 19:44:22 GMT
  10. Lines: 56
  11.  
  12. I am having some difficulty unearthing all of the different ways
  13. you can trap Ingres EQUEL/ESQL errors for the C language.
  14.  
  15. I will try to summarize my thoughts and would like people to tell me
  16. how they think it works (I am most likely wrong anyhow).
  17.  
  18. Ways to capture/get errors in EQUEL
  19. -----------------------------------
  20.  
  21. (1) Use the IIseterr function to define an error handler which will be
  22.     called by Ingres if there is an Ingres error.
  23.  
  24. (2) Issue the inquire_ingres (inquire_equel) command to find out the 
  25.     error number and deal with it.  This option would have to be used
  26.     in a case by case basis.
  27.  
  28. Now, my question is, will option (2) suppress msgs going to stdout, unless
  29. I explicitly tell it to output error messages?
  30.  
  31. Ways to capture/get errors in ESQL
  32. -----------------------------------
  33.  
  34. (1) Declare the SQLCA structure, and check the sqlcode member in a case
  35.     by case basis.
  36.  
  37. (2) Declare the SQLCA structure and use the "whenever" statement deal with
  38.     warnings, or errors.  This also enables you to call your a user
  39.     defined function, and it is only valid for the SQL statements which follow
  40.     it's definition inside the source module.
  41.  
  42. (3) Define an error trapping routine which can then be set using the 
  43.     set_sql command. I think that the SQLCA shouldn't be defined.
  44.  
  45. (4) You can use the inquire_sql statement to find out the error, although
  46.     it does say this does not suppress messages to the screen.
  47.  
  48. (5) You can use the IIseterr function, like above.
  49.  
  50.  
  51. SQL seems to have more variety but the documentation doesn't really 
  52. do a great job of defining what you can do.  It seems that under ESQL,
  53. option (1) should really be used as well as option (2).  Option (3)
  54. seems to the equivalent of (5) which seems to be the equivalent of 
  55. EQUEL's option (1).
  56.  
  57. I would like to know what I've screwed up in the above ramblings, and 
  58. I'd be interested in knowing how people handle error checking in 
  59. ESQL especially for C.
  60.  
  61. thanks,
  62.  
  63.  
  64. --tom
  65.  
  66.  
  67.  
  68.