Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> ProC & Linux
Hi,
I am new im programming with ProC.
I've tried to compile a sample programm from OTN under Linux.
#include <stdlib.h>
#include <stdio.h>
#include "/opt/oracle/precomp/public/sqlca.h"
EXEC SQL BEGIN DECLARE SECTION;
VARCHAR v_user[40];
char* connstr = "/"; /* This HAS to be a '/' */
char* dbalias = "tcp803"; /* This is your SQL*Net Alias */
EXEC SQL END DECLARE SECTION;
void sqlerror();
void main()
{
/* Generic Error Handling */
EXEC SQL WHENEVER SQLERROR DO sqlerror(); EXEC SQL WHENEVER SQLWARNING CONTINUE; /* Generic Code */
EXEC SQL CONNECT :connstr USING :dbalias;
EXEC SQL SELECT USER INTO :v_user FROM DUAL;
printf("%s\n",v_user.arr); return; } void sqlerror() { printf("Stop Error:\t%i\n",sqlca.sqlcode); exit(1);}
and then I get the following error messages ..
tarsus:/opt/oracle# gcc -o test proc_sample.c
proc_sample.c:9: parse error before `SQL' proc_sample.c:9: warning: data definition has no type or storage class proc_sample.c:10: parse error before `v_user' proc_sample.c:10: warning: data definition has no type or storage class proc_sample.c:13: parse error before `SQL' proc_sample.c:13: warning: data definition has no type or storage class proc_sample.c: In function `main': proc_sample.c:21: `EXEC' undeclared (first use this function) proc_sample.c:21: (Each undeclared identifier is reported only once proc_sample.c:21: for each function it appears in.) proc_sample.c:21: parse error before `SQL' proc_sample.c:28: request for member `arr' in something not a structureor union
What's wrong ??
Ciao Guddl
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Andreas Gutowski email: guddl@gmx.de http://www.guddl.de/
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Received on Sun Mar 28 1999 - 05:41:51 CST
![]() |
![]() |