Home » Developer & Programmer » Precompilers, OCI & OCCI » pro*c confirmation
pro*c confirmation [message #255193] Tue, 31 July 2007 00:05 Go to next message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
Hi,
My server is sunos 5.8 and DB is oracle 9i release 2, could you please let me know how to check whether pre compiler is installed. please send me some sample and simple pro*c code.

Thanks.
Re: pro*c confirmation [message #255195 is a reply to message #255193] Tue, 31 July 2007 00:18 Go to previous messageGo to next message
Frank Naude
Messages: 4420
Registered: April 1998
Senior Member
If Pro*C is installed you will have a "proc" executable in your ORACLE_HOME/bin directory.

For more info, see http://www.orafaq.com/wiki/Pro*C
Re: pro*c confirmation [message #255230 is a reply to message #255195] Tue, 31 July 2007 01:29 Go to previous messageGo to next message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
Hi,
Thanks for the link.

"Pro*C - comes bundled with the Oracle client. "

i am using windows xp pro, i have installed oracle 9i client. I could see proc executable unser bin directory.

how to start now?

Thanks.
icon7.gif  Re: pro*c confirmation [message #258980 is a reply to message #255230] Tue, 14 August 2007 00:39 Go to previous messageGo to next message
Reddi
Messages: 2
Registered: August 2007
Junior Member
Hi

http://www.fadalti.com/oracle/proC/how_to_compile_proc.htm

http://orafaq.com/faqpro.htm

http://download.oracle.com/docs/cd/B10501_01/win.920/a96111.pdf

http://download.oracle.com/docs/cd/B10501_01/appdev.920/a97269.pdf

-G.R
Re: pro*c confirmation [message #261382 is a reply to message #258980] Wed, 22 August 2007 07:48 Go to previous messageGo to next message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
Thanks for these link.
It is really useful for me.

i have checked whether c compiler is packed with my OS by issuing cc -v, but it seems that only i have gcc.
Please let me know what are the changes to be done if i want to compile and execute my proc code

Thanks.
Re: pro*c confirmation [message #261390 is a reply to message #261382] Wed, 22 August 2007 08:20 Go to previous messageGo to next message
Michel Cadot
Messages: 60012
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Just set the CC variable to gcc instead of cc when you call make or in the makefile.

Regards
Michel
Re: pro*c confirmation [message #261520 is a reply to message #261390] Wed, 22 August 2007 22:56 Go to previous messageGo to next message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
Thanks Michel.

Where do i need to set CC variable? do i need to set in make file...?

CPPSAMPLES=cppdemo1 cppdemo3 shahnaz

i just appended like above in make file, is it right?

Thanks.
Re: pro*c confirmation [message #261525 is a reply to message #261520] Wed, 22 August 2007 23:28 Go to previous messageGo to next message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
My shahnaz.pc content is
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

EXEC SQL BEGIN DECLARE SECTION;
VARCHAR uid[20];
VARCHAR pwd[20];
EXEC SQL END DECLARE SECTION;

EXEC SQL INCLUDE SQLCA;

main()
{
strcpy ((char *)uid.arr,"scott");
uid.len=(unsigned short)strlen((char *)uid.arr);
strcpy ((char *)pwd.arr,"tiger");
pwd.len=(unsigned short)strlen((char *)pwd.arr);

printf("\n\n Embedded PL/SQL Debit Transaction Demo\n\n");
printf("Trying to connect...");

EXEC SQL WHENEVER SQLERROR GOTO errprint;

EXEC SQL CONNECT :uid IDENTIFIED BY :pwd;
printf(" connected.\n");
errprint:
EXEC SQL WHENEVER SQLERROR CONTINUE;
printf("\n\n>>>>> Error during execution:\n");
printf("%s\n",sqlca.sqlerrm.sqlerrmc);
EXEC SQL ROLLBACK RELEASE;
exit(1);
}


when i compile
make -f demo_proc.mk shahnaz

gives me error like

make: *** No rule to make target `empclass.pc', needed by `empclass.o'. Stop.
Re: pro*c confirmation [message #261597 is a reply to message #261525] Thu, 23 August 2007 02:00 Go to previous messageGo to next message
Michel Cadot
Messages: 60012
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read and follow How to format your posts
Please do not use red color it hurst the eyes.

Your error has nothing to do with your code.
You have an error in the makefile.

Regards
Michel
Re: pro*c confirmation [message #261626 is a reply to message #261597] Thu, 23 August 2007 02:46 Go to previous messageGo to next message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
I just copied this make file to my local directory from $ORACLE_HOME/precomp/demo/proc
and then i just modified make file
CPPSAMPLES=cppdemo1 cppdemo3 shahnaz

is it required to do anything other than this?

Thanks.



Re: pro*c confirmation [message #262767 is a reply to message #261626] Tue, 28 August 2007 04:36 Go to previous messageGo to next message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
i have created proc file like ex.pc

proc iname=ex.pc

it created ex.c

when i run gcc -o ex ex.c

it shows me the error

Undefined first referenced
symbol in file
sqlcxt /var/tmp/cc6EUeUl.o
ld: fatal: Symbol referencing errors. No output written to ex
collect2: ld returned 1 exit status


Any idea what i have to do?

Thanks.
Re: pro*c confirmation [message #264336 is a reply to message #262767] Mon, 03 September 2007 01:09 Go to previous messageGo to next message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
Any update on this post?

Thanks
Re: pro*c confirmation [message #269631 is a reply to message #264336] Sun, 23 September 2007 22:43 Go to previous message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
Can any body answer for my question?

Thanks.
Previous Topic: occi: No such file or directory -- error: `oracle' has not been declared
Next Topic: Updation using host arrays
Goto Forum:
  


Current Time: Sun Dec 21 18:26:30 CST 2014

Total time taken to generate the page: 0.28370 seconds