Re: Pro*C & C-precompiler coexistence problem
Date: 1996/03/27
Message-ID: <DoxtFB.ACA_at_statcan.ca>#1/1
In R2.0 of PRO*C you can use defines (as we do) to in defining lengths of arrays in declarations. See the manuals.
However, you have to be careful with the use of defined constants beyond declarations. We found PRO*C to be inconsistent in where it supports substitutions and where it doesn't. We could use them in declaraions but found them to be troublesome in where clauses in embedded SQL.
Hope this helps.
PGY (Opinions expressed are mine and mine alone)
################################################################ # Paul Young # # youngpa_at_statcan.ca # # Statistics Canada # ################################################################
Suu Quan (quan_at_hpcc01.corp.hp.com) wrote:
: I would like to do this in my Pro*C
: #define LENGTH 23
: ...
: columnName varchar(LENGTH), ...
: instead of the infamous
: columnName varchar(23),
: What I did was run the .pc file against the C precompiler cpp, but
: in the next step, proc barfed.
: Is there a way to remove the hardcoded length ?
: ------------ session recorded ----------
: /lib/cpp -P -I. -I/opt/oracle/product/7.1.6/sqllib/public repricem_f.pc
: repricem_f.ppc
: /opt/oracle/product/7.1.6/bin/proc sqlcheck=semantics userid=xxx/yyy
: dbms=v6_char ireclen=132 oreclen=132 code=ansi_c iname=repricem_f.ppc
: Pro*C: Release 2.0.6.0.0 - Production on Wed Mar 27 08:15:03 1996
: Copyright (c) Oracle Corporation 1979, 1994. All rights reserved.
: System default option values taken from: /opt/oracle/product/7.1.6/proc/pmscfg.h
: BEGIN debug.SetMode ((0), :g_int_debug_lvl);
: ....................1
: (1) PCC-S-02306, wrong number or types of arguments in call to 'SETMODE'
: BEGIN debug.SetMode ((0), :g_int_debug_lvl);
: ....................1
: (1) PCC-S-02000, Statement ignored
: Semantic error at line 932, column 9, file repricem_f.ppc:
: BEGIN debug.SetMode ((0), :g_int_debug_lvl);
: ........1
: (1) PCC-S-02346, PL/SQL found semantic errors
: BEGIN debug.SetMode ((1), :g_int_debug_lvl);
: ....................1
: (1) PCC-S-02306, wrong number or types of arguments in call to 'SETMODE'
: BEGIN debug.SetMode ((0));, :g_int_debug_lvl);
: ..................1.1
: (1) PCC-S-02306, wrong number or types of arguments in call to 'SETMODE'
: BEGIN debug.SetMode ((0));n 9, file repricem_f.ppc:
: ..................1g.SetMode ((1), :g_int_debug_lvl);
: (1) PCC-S-02000, Statement ignored
-- PGY (Opinions expressed are mine and mine alone) ################################################################ # Paul Young # # youngpa_at_statcan.ca # # Statistics Canada # ################################################################Received on Wed Mar 27 1996 - 00:00:00 CET