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

Home -> Community -> Usenet -> c.d.o.misc -> ProC & Linux

ProC & Linux

From: Andreas Gutowski <andreas.gutowski_at_nk.anzeiger.net>
Date: Sun, 28 Mar 1999 13:41:51 +0200
Message-ID: <36FE157F.A499C8B8@nk.anzeiger.net>


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 structure
or 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

Original text of this message

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