Re: Pro*C & C-precompiler coexistence problem
Date: 1996/03/29
Message-ID: <4jflho$gl6_at_news01.aud.alcatel.com>#1/1
quan_at_hpcc01.corp.hp.com (Suu Quan) wrote:
> I would like to do this in my Pro*C
>
> #define LENGTH 23
> ...
> columnName varchar(LENGTH), ...
>
> instead of the infamous
>
> columnName varchar(23),
The Oracle Pro*c compiler does not recognize your C-precompiler directives.
However, you can achieve the same functionality using PL/SQL constants or
have an .H file like so:
EXEC SQL BEGIN DECLARE SECTION; long ORACLE_CONST_NAME = 123;
char ORACLE_CONST_VAL 'A';
char ORACLE_STRING_VAL[ # ] = "a line";
EXEC SQL END DECLARE SECTION; -Try these and look at what the Pro-c compiler does.
-Varchar won't work - try it and see what the precompiler does.
Then, in your c code, do:
EXEC SQL INCLUDE filename.h;
(I also would not use LENGTH since that is a PL/SQL function. )
-Austin. Received on Fri Mar 29 1996 - 00:00:00 CET