Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: connection problem in Pro*c
A copy of this was sent to scip6125_at_leonis.nus.edu.sg (Zhao Fu)
(if that email address didn't require changing)
On 24 Dec 1998 07:01:35 GMT, you 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:
>
You've added 2 concepts to this connect:
I think you just want to use:
EXEC SQL CONNECT :user IDENTIFIED BY :pass USING :db_string;
or more simply:
EXEC SQL CONNECT :user_pass_db_string
where :user_pass_db_string = "username/password_at_databasename" like you would give to sqlplus....
>Connected to ORACLE as user: scott
>
>Enter employee number (0 to quit): 2345
>
>ORACLE error--
>
>ORA-01012: not logged on
>
>I wonder if it is a still problem with the Oracle connection. Could
>anybody give me some advice?
>
>TIA
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA
--
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Thu Dec 24 1998 - 13:20:33 CST
![]() |
![]() |