Re: Pro*C++: Problem with Pointer to Array of Struct
Date: Thu, 20 Apr 2000 09:48:13 +1000
Message-ID: <8dlgha$k5e_at_newshost.fujitsu.com.au>
Ullrich,
[Quoted] 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,
[Quoted] 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 );
.............................................1PCC-S-02322, found undefined indentifier
So, has anyone got an idea?
Thx
Ullrich
Received on Thu Apr 20 2000 - 01:48:13 CEST