Help with structs and .ec
Posted in 1992
Hi,
I having problems fetching into a structure when using a prepare.
I will explain.
/*------------------------------------------------------------*/
$struct open{
int var1;
int var2;
char var3;
};
$struct open open_rec;
main()
{
$declare X cursor for
select * from table where table.var1 = 2; $open;
$fetch X into $open_rec;
}
/*------------------------------------------------------------*/
This above example works ok. The following example fails on the
compile with the following error:
line 13: RECORD objects 'open_rec' are not allowed in this list
/*------------------------------------------------------------*/
$struct open{
int var1;
int var2;
char var3;
};
$struct open open_rec;
main()
{
char qvar[200];
strcpy(qvar,"select * from table where table.var1 = 2");
$prepare Y from $qvar;
$declare X cursor for Y;
$open;
$fetch X into $open_rec;
}
/*------------------------------------------------------------*/
if I replace $fetch X into $open_rec; with
$fetch X into $open_rec.var1,$open_rec.var2,$open_rec.var2
it works ok.
The problem is the tables that I need to fetch in real life have
LOTS of columns.
Thanks for any help..
--
------------------------------------------------------------------------
|--------------| # -------------------------------|
| Randy Paries | ____/| _______| b8!turq!randy |
| x6191 cr041| \\ oO| / | uunet!ingr!b8!turq!randy |
|--------------| ## | ~|_/ ## | randy@turq.b8.ingr.com |
#### `-U' #### |Intergraph, Huntsville Alabama|
\\\\ || // ================================
TEAM "CATS" \\/ \\/ ples exuse al speln mstaks
"Smells like team spirit" | |
------------------------------------------------------------------------