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

Home -> Community -> Usenet -> c.d.o.server -> Re: ANSI + ProC ???

Re: ANSI + ProC ???

From: Paul Kapp <plkapp_at_erols.com>
Date: 1997/06/26
Message-ID: <33B327ED.2181@erols.com>#1/1

Bas Ven wrote:
>
> Hi,
>
> I am trying to get the following typedef to be accepted by
> the Oracle ProC (version 2.0.6.0.0) precompiler. The docs
> state that this precompiler is ANSI compliant
> (with the CODE option).
>
> When I create the following declaration:
>
> typedef struct {
> int i;
> int b;
> } Test, *pTest;
>
> the ProC compiler can't handle it and complains about the
> comma between Test and *pTest. I always thought this kind
> of declaration is/was valid (ansi) C.
> I hope someone can tell me that this either is not valid
> (ansi) C or that ProC is f*cked.
>

The statement that Pro*C is ANSI compliant likely means that it conforms to ANSI standards for Embedded SQL processing, not that it is guaranteed to handle a strict superset of ANSI-C. Although I haven't worked with Oracle/Pro*C in a few years, I seem to recall that the precompiler will pass through source verbatim, unless

1) within a BEGIN DECLARE SECTION/END DECLARE SECTION block
2) The statement is prefixed with EXEC SQL or $
3) You are instructing the precompiler (not the C preprocessor) to

   include a header file.

Unless you intend to use the struct, in whole or in part, as an SQL host variable, there are ways of avoiding Pro*C attempting to interpret its declaration, and pass the source, verbatim, through to your (ANSI) C compiler.

The declaration looks to me, and to the other responders, as valid ANSI C syntax. You may get more accurate info from comp.databases.oracle, or another oracle specific group, or email me back at plkapp_at_erols.com

Paul. Received on Thu Jun 26 1997 - 00:00:00 CDT

Original text of this message

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