Re: Pro*C++: Problem with Pointer to Array of Struct

From: Ullrich Bartels <ullrich.bartels_at_t-online.de>
Date: Thu, 20 Apr 2000 14:24:15 +0100
Message-ID: <38FEF6EF.DEAB8ED8_at_t-online.de>


Geoff,

I had in fact the "dept" in my source but somehow I've thrown it away when writing down the problem.

So, the problem still remains, both on NT and Linux systems!!!

Geoff Mountfort wrote:
>
> Ullrich,
> try adding "dept;":
>
> typedef struct dept
> {
> int deptno;
> char dname[15];
> char loc[14];
> } dept;
>
> as in the documentation.
>
> When I ran your code through my Pro*C/C++ it dumped core, apparently using
> the algorithm:
> if (syntax error detected)
> dunpCore(); /* that will make them think */
>
> Geoff
>
> Ullrich Bartels wrote in message <38FE1CEB.7952E3F1_at_t-online.de>...
> Hi,
>
> I tried out the example shown in the "Pro*C/C++ Precompiler Programmer´s
> Guide, Chapter 12: Using Host Array, Example6: Using a Pointer to an
> Array of Structs" (pages 12-26/27):
>
> typedef struct dept
> {
> int deptno;
> char dname[15];
> char loc[14];
> }
>
> void insert_data(d, n)
> dept *d;
> int n;
> {
> exec sql for :n insert into dept values ( :d );
> }
>
> The PreCompiler gave the following err message:
>
> Semantic error at line 12, column 17, file test.pc:
> exec sql for :n insert into dept values ( :d );
> ................1
> PCC-S-02322, found undefined indentifier
> Semantic error at line 12, column 17, file test.pc:
> exec sql for :n insert into dept values ( :d );
> ................1
> PCC-S-02330, expecting an expression of integer type
> Semantic error at line 12, column 46, file test.pc:
> exec sql for :n insert into dept values ( :d );
> .............................................1
> PCC-S-02322, found undefined indentifier
>
> So, has anyone got an idea?
>
> Thx
> Ullrich
Received on Thu Apr 20 2000 - 15:24:15 CEST

Original text of this message