Christof Petig wrote:
> > > > exec sql type str is varchar;
> > > > str *var=NULL;
> > >
> > > Shudder. There should be a decent syntax to specify this. If anyone ever
> > > needs this functionality!!!
I found the actual way to get this :
- it is possible to create a pointer to a varchar, simply use the
braindead (to me) syntax:
- ecpg and the C compiler do not agree on the meaning of
for the compiler it is an array of 80 char*s
for ecpg it's obviously equivalent to char foo; (simply try it)
which is pretty useless for an output variable but might be ok for an input
variable if the offset (sizeof char) would be right (sizeof char*).
- the interesting syntax
char (*foo); (pointer to an array of char)
is not possible in ecpg, but seems to be the one supported by the lib.
To sum it up: variable declaration and variable initialization are some of the
weakest points in ecpg.
Christof (implementing char **)
PS: casts do not work when initializing variables ( e.g. int VAR = (int) 1.5; ->
In response to
pgsql-interfaces by date
|Next:||From: Christof Petig||Date: 2001-10-30 10:02:28|
|Subject: Re: ECPG - connection name in "EXEC SQL AT ... " statement|
|Previous:||From: DI Hasenöhrl||Date: 2001-10-30 08:42:20|
|Subject: Re: DAO VB ODBC "read only problems|