PRO*C and SQL CONNECT

From: Bruce Van Dotten <bvd_at_mis.engnet.ufl.edu>
Date: 12 Aug 1993 18:18:52 GMT
Message-ID: <24e1ic$kvo_at_bigguy.eng.ufl.edu>


I wish to write a C executable program that performs a simple operation of connecting to the database and running a select statement. My problem is PRO*C and the CONNECT.

   #include <stdio.h>
   #include <string.h>

   .
   .
   . 	 
   EXEC SQL BEGIN DECLARE SECTION;
     VARCHAR userid[50];

.
.

   EXEC SQL END DECLARE SECTION;    EXEC SQL INCLUDE SQLCA;    main()
   { EXEC SQL WHENEVER SQLERROR GOTO sqlerror;      EXEC SQL WHENEVER NOTFOUND GOTO notfound;
     strcpy(userid.arr,"myname/mypasswd_at_t:testdb");
     userid.len = strlen(userid.arr);
      
     EXEC SQL CONNECT :userid;

.
.
.
}

I compile with the standard proc.mk (i.e. 'make -f proc.mk programc ') and then run the program. However, I receive the error message:

   ERROR during Connect - ORA 6105.

What's going wrong!!!
NOTE: I print out the contents of :userid with no problem.

      I use the same CONNECT syntax with sqlplus with no problem.

I am runing Oracle Version 6. Any suggestion would be greatly appreciated. e-mail bvd_at_mis.engnet.ufl.edu Received on Thu Aug 12 1993 - 20:18:52 CEST

Original text of this message