Re: What exception catching methods should be used with Pro*C?
From: joel garry <joel-garry_at_home.com>
Date: Mon, 23 Nov 2009 08:59:16 -0800 (PST)
Message-ID: <986a5e15-0d93-48b2-b7cb-62acb6dd6bb6_at_g22g2000prf.googlegroups.com>
On Nov 22, 7:59 am, Ramon F Herrera <ra..._at_conexus.net> wrote:
> 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
There are some pointers to other places with suggestions here: http://tkyte.blogspot.com/2008/01/why-do-people-do-this.html
Date: Mon, 23 Nov 2009 08:59:16 -0800 (PST)
Message-ID: <986a5e15-0d93-48b2-b7cb-62acb6dd6bb6_at_g22g2000prf.googlegroups.com>
On Nov 22, 7:59 am, Ramon F Herrera <ra..._at_conexus.net> wrote:
> 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
There are some pointers to other places with suggestions here: http://tkyte.blogspot.com/2008/01/why-do-people-do-this.html
jg
-- _at_home.com is bogus. "I'd like to invite you to join my neighborhood network on MerchantCircle. MerchantCircle helps me build stronger relationships with the other businesses in our neighborhood. It's been a big help for me to get referrals and to reach customers. It's exciting to see our local community take shape online, so I hope you'll connect with me and Holistic Health & Medical Marijuana Dispensary! It's free to join and only takes a minute to sign up and connect." - What I get for signing up with MerchantCircle.Received on Mon Nov 23 2009 - 10:59:16 CST