Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Writing Oracle APIs

Re: Writing Oracle APIs

From: Allen Kirby <akirby_at_att.com>
Date: 1997/01/24
Message-ID: <32E8BCA8.56F7@att.com>#1/1

Mars wrote:
>
> Hi,
>
> I need help writing Oracle APIs to be called by a C program. The API
> will be in a shared library and called by my C program.
>
> The problem is that my C program will be running as a daemon and will
> have no Oracle environment settings such as ORACLE_HOME. Is this
> possible?
>
> I've tried to do so but without success. When I do a connect using:
> EXEC SQL CONNECT TO :user
> IDENTIFIED by :passwd
> USING :dbstring;
>
> I get the following error :
> Error while trying to retrieve text for error
> ORA-12154
>
> Which means it cannot find the tnsnames.ora file and cannot get the
> error text because ORACLE_HOME is not set. At the OS level, I can get
> connected via tnsnames.ora without any problems...
>
> Can someone please, please help...I need to get this working by next
> week.
>
> Thanxs!

Who says that a daemon can't have environment variables? If it's started from a shell script, set them before calling the daemon. If it's started from inittab or a rc script, call a shell script that sets the variables then starts the daemon. Or try the 'env' command. We do this all the time!

-- 
---
Allen Kirby			AT&T ITS Production Services
akirby_at_att.com			Alpharetta, GA.
Received on Fri Jan 24 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US