Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Help with Pro*C
Hello,
I am trying to learn Pro*C and got stuck in the very begining. I really
appreciate any advise.
I have the following simple program SampleSel.pc:
#include<stdio.h> #include<stdlib.h> #include<sqlca.h>
INTO Acct FROM tblTest WHERE Amt>14; printf ("After connection string.\n");
.
.
.
.
.
.
.
Then I copied ORACLE demo_proc.mk to the directory and compiled my
program as following:
make -f demo_proc.mk build EXE=SampleSel OBJS=SampleSel.o
I got the following message for compliling:
cc -o SampleSel SampleSel.o -L/appl/app/oracle/product/8.1.7/lib/
-lclntsh
`cat /appl/app/oracle/product/8.1.7/lib/sysliblist`
-R/appl/app/oracle/product/8.1.7/lib -laio -lm -lthread
I assume it means that everything is all right,
Then I ran it as following: SampleSel
I got the following:
Before the connection starts.
Connection string is: MyUserID/MyPassword_at_MyDB
Segmentation fault
I guess the problem is in the EXEC SQL CONNECT :connstr;
Can anyone out there give me any advise?
BTW, I can successfully connect SQLPlus in the same machine using the
smae id and password.
Thanks a lot in advance.
Received on Mon Oct 31 2005 - 13:35:30 CST