Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: ProC problem: exec sql connect
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.
My first suggestion would be to separate the various components into their own host variables and give that a try:
char uid[50];
char pwd[50];
char dbname[50];
sprintf(uid,"user"); sprintf(pwd,"password"); sprintf(dbname,"tnsname");
exec sql declare db_name database;
exec sql connect :uid identified by :pwd at db_name using :dbname;
If that doesn't work take a look at your compiler options. Try turning off optimization. Try compiling with whatever your equivelent of -KPIC is (position independent code). Make sure you are compiled with -Xa (code must be ansi standard). Try compiling with -dn (static linking). Try the option which controls whether inlining is allowed - set it to disallow inlining. Received on Wed Oct 20 1999 - 07:04:47 CDT
![]() |
![]() |