Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!caen!june.engin.umich.edu!lwk From: lwk@caen.engin.umich.edu (Woody Kellum) Newsgroups: comp.databases Subject: Re: Oracle TWO_TASK Message-ID: <1991Feb11.154250.4908@engin.umich.edu> Date: 11 Feb 91 15:42:50 GMT References: <49392@seismo.CSS.GOV> Sender: news@engin.umich.edu (CAEN Netnews) Organization: University of Michigan Engineering, Ann Arbor Lines: 45 In article <49392@seismo.CSS.GOV> jean@beno.CSS.GOV (Jean Anderson) writes: > >We use TWO_TASK to connect to remote databases with PRO*C and PRO*FORTRAN >applications and have never had to append the TWO_TASK information to the >database connect string. Occasionally, however, some poor soul doesn't have >his/her environment set up properly. To head this confusion off at the pass, >we include something like the following in our dbopen routine before we >even try to do the connect: > > uidptr=strchr(uid, '@'); /* Is sqlnet info explicitely in uid? */ > if(uidptr == NULL) /* sqlnet info not in uid */ > { > p=getenv("TWO_TASK"); /* Is TWO_TASK set? */ > if(p == NULL) /* TWO_TASK not set */ > { > p=getenv("ORACLE_SID"); /* Is ORACLE_SID set? */ > if(p == NULL) /* ORACLE_SID not set */ > { > fprintf(stderr,"Database environment not set up--see your DBA\n"); > return(BADDATA); > } > } > } > > >I periodically get email: "Uh, what do I need to do to set my environment >up for the database?" > > - Jean Anderson I have a shell file that I have users source before they try to connect which sets up their environment for them. All they give is the alias name of the DB they want to connect to. The first thing I ask when they call with problems is: "Did you source the oracle file first?" -- I want a GOOD reason with some moral backbone why Americans are dying in the Mid East. Woody Kellum Internet: lwk@caen.engin.umich.edu