Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: pro*c

Re: pro*c

From: Peter Sylvester <not_me_at_not_here.org>
Date: Thu, 12 Jan 2006 17:39:55 -0500
Message-ID: <dq6lv0$fia$1@newslocal.mitre.org>


sac wrote:
> Hi
> i am using pro*c version on 9 on winxp...
>
> i saved the below program as a .pc file and in pro*c ran that....it was
> converted to .c file ....i compiled that .c file in vc++ ...first of
> all it showed the error that sqlca.h not found, so copied that file
> from oracle_home\precomp\public...to c:\program files\microsoft visual
> studio\vc98\include..so it woked fine..then it somehow compiled fine
> and then i tried to build that file to make an .exe of that it showed 3
> errors:
>
> error lnk 2001: unresolved external symbol
> really_complex_calculation()..
> error lnk 2001: unresolved external symbol sqlerror_hard()
> error lnk 2001: unresolved external symbol sql_ctx()
>
>
> pLEASE GUIDE HOW TO RESOLVE THIS.. am i doing everything correctly..
>
>
>
> #include <stdio.h>
> #include <sqlca.h>
>
> main( argc, argv )
> int argc;
> char * argv[];
> {
> EXEC SQL BEGIN DECLARE SECTION;
> varchar oracleid[31];
> int x;
> EXEC SQL END DECLARE SECTION;
>
> strcpy( oracleid.arr, "scott/tiger_at_foo" );
> oracleid.len = strlen(oracleid.arr);
>
> EXEC SQL WHENEVER SQLERROR DO sqlerror_hard();
> EXEC SQL CONNECT :oracleid;
> printf("\nConnected to ORACLE as user: %s\n\n", oracleid.arr);
>
> x = really_complex_calculation();
>
> exec sql insert into xx ( x ) values ( :x );
>
> /* Disconnect from ORACLE. */
> /* EXEC SQL COMMIT WORK RELEASE; */
> exit(0);
> }
>
>
>
> thanks
>
>
>
> Volker Hetzer wrote:
>
>

>>sac wrote:
>>
>>>Hi all,
>>>
>>>i have a simple pro*c program(i have pro*c installed , oracle ver 9,
>>>dont have c application installed)..could anyone tell me how to run
>>>that..like i can run that in pro*c which show green check mark in front
>>>of it ..NOW WHAT TO DO AFTER THAT ..I DONT KNOW  ...please help
>>
>>Please ask yourself whether it's really worth the bother to
>>use pro*c in a C/C++ applicaiton on windows. And if the answer is simply
>>"what else is there" then don't.
>>Oracle has a nice ActiveX control that can be used from any number of
>>programming or scripting languages, including C/C++/VB/VBScript/JScript/Perl/Tcl
>>and whatever else is there. It's fast too, apart from object management, but
>>I very much doubt that pro*c can help you there either.
>>
>>Also what is a "c application"?
>>And who is responsible for your oracle database? Your DBA could probably
>>help you too.
>>
>>Lots of Greetings!
>>Volker

>
>

You need to look at the Makefiles (or "project" files or whatever VC uses) to see how to invoke the compiler with the correct options to find the header and library files. Copying them around is not the right way.

Try to build one of the included Oracle examples and get it to run sucessfully first.

--Peter Received on Thu Jan 12 2006 - 16:39:55 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US