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: ProC problem: exec sql connect

Re: ProC problem: exec sql connect

From: Johannes Wilhelm <x15_at_aixterm8.urz.uni-heidelberg.de>
Date: 20 Oct 1999 09:56:01 GMT
Message-ID: <7uk3jh$41n$1@news.urz.uni-heidelberg.de>


soekotjo_at_my-deja.com wrote:
> Hi all,
> I am trying to connect to a remote database from a ProC
> procgram, but hit a problem.
> I used this piece of code:

> char localstr[200];
> sprintf(localstr,"user/password_at_tnsname");
> exec sql connect :localstr;

> and it core dumps with ILL signal (illegal instruction).

> I tried running sqlplus with the same user/password_at_tnsname
> combination, and it works. So the tnsname part is OK.

> I'm using Oracle 7.3.4 on Digital Unix 4.0F.

> Any help will be much appreciated.

> Sent via Deja.com http://www.deja.com/
> Before you buy.

You must enter:

EXEC SQL BEGIN DECLARE SECTION;
   varchar localstr1[200];
   varchar localstr2[200];
EXEC SQL END DECLARE SECTION;
   sprintf(localstr1.arr,"user_at_tnsname");    localstr1.len=strlen(localstr1.arr);    sprintf(localstr2.arr,"password");
   localstr2.len=strlen(localstr2.arr);    EXEC SQL CONNECT :localstr1 IDENTIFIED BY :localstr2;

Johannes Received on Wed Oct 20 1999 - 04:56:01 CDT

Original text of this message

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