Re: What exception catching methods should be used with Pro*C?

From: Ramon F Herrera <ramon_at_conexus.net>
Date: Sun, 22 Nov 2009 07:59:28 -0800 (PST)
Message-ID: <93e06f8a-0ffd-466f-8b26-f24568ff1d28_at_l2g2000yqd.googlegroups.com>



On Nov 22, 10:47 am, Ramon F Herrera <ra..._at_conexus.net> wrote:
> My application assembles SQL queries at run time, using C++ (a
> language which is very good at error handling, based on the
> try...catch statement) and executes them in C, more specifically using
> Oracle Pro*C.
>
> I have doubts about the error handling methods to be applied. I am
> trying to figure out how to catch any error while the Pro*C code is
> being executed and to pass them upstream to the C++ layer. I must add
> that the application is a never-ending server and therefore it must
> not crash or even "exit()" upon failure.
>
> Your comments/pointers are most appreciated and welcome.
>
> TIA,
>
> -Ramon

I have been using a couple of error catching statements:

  • EXEC SQL WHENEVER SQLERROR DO sql_error("ORACLE error--\n");
  • EXEC SQL WHENEVER NOT FOUND DO user_not_found();

and I was wondering if there is anything else that I could take advantage of.

TIA, -RFH Received on Sun Nov 22 2009 - 09:59:28 CST

Original text of this message