Re: PRO*C & Stored Procedures

From: Marc Lodico <mlodico_at_NOSPAMbigfoot.com>
Date: 1998/01/15
Message-ID: <34BDB7F3.F17374D3_at_NOSPAMbigfoot.com>#1/1


Ditch the database name in the program, there is no need to hard code it. In Unix, the instance that you connect to is determined by the environment variable
ORACLE_SID. Marc Lodico
mlodico_at_bigfoot.com

Lawrence Simela wrote:

> Could you give us an example of what you mean?
>
> Surely calling a packaged function from pro*c is something like:
>
> EXEC SQL EXECUTE
> DECLARE
> C_TRUE INTEGER := 1;
> C_FALSE INTEGER := 0;
> BEGIN
> IF pkg.function THEN
> :bUpdateSucceeded:nUpdateInd := C_TRUE;
> ELSE
> :bUpdateSucceeded:nUpdateInd := C_FALSE;
> END IF;
> EXCEPTION
> WHEN OTHERS THEN
> :bExceptionOccurred:nExcInd := C_TRUE;
> :bUpdateSucceeded:nUpdateInd := C_FALSE;
> END;
> END-EXEC;
>
> why do you need to include the database name in the call? Please clarify..
>
> Lawrence Simela
> MAHALINI CONSULTING LIMITED
>
> Michael Plakus wrote in message <692rtt$24k$0_at_208.10.2.144>...
> >I would like to write a PRO*C program to call a stored procedure. I've
> >got it to work, but I have to specify the database name as part of the
> >call. When I do this and run on our development box it works fine,
> >however the database name on the production box is different than the
> >database name on the developement box. When I copy the compiled code to
> >the development box it won't run. I've tried changing the name of the
> >database on the development box, but PRO*C must validate, because I get
> >a compiler error reporting the stored procedure is not there. Is there a
> >way to code this so I don't have to put the database name in the
> >program?
> >
> >Thanks.
> >
> >--
> > Bright images flashing by
> > Like windshields towards the fly
> >
> >
Received on Thu Jan 15 1998 - 00:00:00 CET

Original text of this message