Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Urgent help for Pro*C.
A copy of this was sent to Abhimanyu Parasher <aparashe_at_yallara.cs.rmit.edu.au>
(if that email address didn't require changing)
On 25 Apr 1999 15:35:05 GMT, you wrote:
>Hi!
> Can anybody help me for Pro*C. I'm using a small code for input. After compiling it with proc compiler it gives me the .c file. When I try to compile this .c file it gives me error for an undefined symbol sqlcxt which I think is being created by proc compiler. I don't know which header file to be used for this symbol. Can anybody help?
>
>Please help. I need it urgently.
>
I've found it easiest to just include the sample makefile included in the precompiler directory and use the symbolic in there to link with. For example, by including the proc sample .mk file, I can simply use " -L$(ORACLE_HOME)/lib $(PROLDLIBS)" in my link line to get the right oracle libs, regardless of version.
This is a makefile template I use alot. I set up the symbolics:
TARGET = name of program I want to create SOURCE = list of .pc files I need to precompile/compile
PROC_ENV_FLAGS = any settings I want to override at make time for ProC. Since you have embedded PL/SQL blocks, you will need to add to this "userid=user/pass sqlcheck=semantics" for precompiling...
CC_ENV_FLAGS = any setting I want to override at make time for CC
$(CC) $(LDFLAGS) -t -o $(TARGET) \
$(SOURCE:.pc=.o) -L$(ORACLE_HOME)/lib $(PROLDLIBS)
include $(ORACLE_PROC_MAKEFILE)
PROCFLAGS= ireclen=255 lines=yes $(PROC_ENV_FLAGS) \
include=$(ORACLE_HOME)/proc/lib PROFLAGS=$(PROCFLAGS) CFLAGS=-I. -g $(CC_ENV_FLAGS)
o70: setenv ORACLE_PROC_MAKEFILE $ORACLE_HOME/proc/demo/proc.mk o71: setenv ORACLE_PROC_MAKEFILE $ORACLE_HOME/proc/demo/proc.mk o72: setenv ORACLE_PROC_MAKEFILE $ORACLE_HOME/proc/demo/proc.mk o73: setenv ORACLE_PROC_MAKEFILE $ORACLE_HOME/precomp/demo/proc/proc.mk o8 : setenv ORACLE_PROC_MAKEFILE $ORACLE_HOME/precomp/demo/proc/demo_proc.mk
>Thanks & Regards
>
>Abhimanyu Parasher
>
>
>EXEC SQL INCLUDE SQLCA;
>EXEC SQL INCLUDE SQLDA;
>EXEC SQL INCLUDE ORACA;
>
>main()
>{
> strcpy (uid.arr,"aparashe");
> uid.len=strlen(uid.arr);
> strcpy (pwd.arr,"manshu212");
> pwd.len=strlen(pwd.arr);
>
> printf("\n\n\tEmbedded PL/SQL Demo\n\n");
> printf("Trying to connect...");
>
>
> EXEC SQL CONNECT :uid IDENTIFIED BY :pwd;
> printf(" connected.\n");
> for (;;) /* Loop infinitely */
> {
> printf("**************************************");
> printf("* 1. Edit Student Data *");
> printf("* 1. Edit Subjects Data *");
> printf("* 1. Edit Courses Data *");
> printf("* 1. Edit Enrolment Data *");
> printf("**************************************");
> printf(" Enter Choice : ");
> scanf("%d", Choice);
> if(Choice == 0)
> {
> EXEC SQL COMMIT WORK RELEASE;
> exit(0);
> }
>
> EXEC SQL EXECUTE
>
> BEGIN
> IF :Choice = 1 THEN
> :status := 'gone in';
> END IF;
> END;
> END-EXEC;
> status.arr[status.len] = '\0';
> printf("Status = %s", status.arr);
>
> }
>}
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA
--
http://govt.us.oracle.com/ -- downloadable utilities
![]() |
![]() |