pro*c confirmation [message #255193] |
Tue, 31 July 2007 00:05 |
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 #255230 is a reply to message #255195] |
Tue, 31 July 2007 01:29 |
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.
|
|
|
|
Re: pro*c confirmation [message #261382 is a reply to message #258980] |
Wed, 22 August 2007 07:48 |
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 #261520 is a reply to message #261390] |
Wed, 22 August 2007 22:56 |
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 |
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 #261626 is a reply to message #261597] |
Thu, 23 August 2007 02:46 |
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 |
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.
|
|
|
|
|