Re: connection problem in Pro*c

From: Uwe Schneider <pi_at_nospam.richard-schneider.de>
Date: Fri, 23 Apr 1999 21:04:08 +0200
Message-ID: <3720C428.FF871214_at_nospam.richard-schneider.de>


Hi,

Zhao Fu wrote:
>
> I am running the sample1 file from $ORACLE_HOME/precomp/demo/ on Sun
> Unix workstation, however I couldn't connect to the oracle database on
> system. Later, I found that our connection setting is a non-default
> connection via Net8. So, I referred to the manual and made the
> following change to the code:
>
> ************************************************************************
> char username[10] = "scott";
> char password[10] = "tiger";
> char db_string[20] = "mcora"; /* my code, "mcora" is the SID*/
> EXEC SQL DECLARE DB_NAME DATABASE; /* my code*/
> EXEC SQL CONNECT :username IDENTIFIED BY :password AT DB_NAME USING
> :db_string; /* I appended the AT ... USING ... phrase*/
> ************************************************************************
>
> However, when I ran the program, it seemed that I could connect to the
> database, but I couldn't execute any SQL command after
> that(e.g.SELECT).
> The error code is ORA-01012: not logged on. The following is the output
> message:

Your code looks OK but you really should give us the Oracle error number of the
CONNECT statement. Either you query the sqlca struct or you get the message with sqlqlm().

Uwe

-- 
Uwe Schneider       | Telefon +49 7251 / 82587
Karlsdorfer Str. 31 | Mail    pi_at_richard-schneider.de
DE-76646 Bruchsal   | 
Linux - OS al dente!
Received on Fri Apr 23 1999 - 21:04:08 CEST

Original text of this message