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

Home -> Community -> Usenet -> c.d.o.server -> Re: If is a user process connected to the database?

Re: If is a user process connected to the database?

From: Alex Vinokur <alexander.vinokur_at_telrad.co.il>
Date: Thu, 25 Nov 1999 08:08:07 GMT
Message-ID: <H76%3.2525$Mg.74039@c01read03-admin.service.talkway.com>


On Tue, 23 Nov 1999 08:09:06 -0500 Kenneth C Stahl <BlueSax_at_Unforgettable.com> wrote:
> Alex Vinokur wrote:
> >
> > Hi,
> >
> > 1. How can we know in Pro*C/C++
> > if a user process is connected to the database?
> > P.S. I have got
> > ORA-01012: not logged on
> >

[snip]
> >
> > What does it mean : ... connected to terminates?
> > Why (and when) does it happen?
> >
> > //#########################################################
> > //------------------- Environment -------------------------
> >
> > === Oracle 8.0.5
> > === Pro*C/C++ : Release 8.0.5.0.0
> > === SunOS 5.6
> >
> > //---------------------------------------------------------
> >
> > //#########################################################
>
> It means that you are attempting to perform database operations (DML
> probably) when you are not in a logged in status.
>
> When your program does the connect, does it check whether the connectionion
> was successful by examinging sqlca.sqlcode or having something like:
>
> EXEC SQL WHENEVER SQLERROR GOTO XYZ;
>
> If you don't do either then you have no way of knowing why the connection
> failed.
>
>

[snip]

Thanks.

My print_error () function used to contain

        EXEC SQL ROLLBACK RELEASE.
I had deleted this statement, my program began working OK.

        Alex
--
Free audio & video emails, greeting cards and forums Talkway - http://www.talkway.com - Talk more ways (sm) Received on Thu Nov 25 1999 - 02:08:07 CST

Original text of this message

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