Re: Retrieving "car" values without blank with esql
Posted in 2003
----- Original Message ----- To: screen.cleaning@caramail.com At: 8/ 4 8:21 Change the data type of parameter.values from char to string. There are 4 types of character host variable in ESQL/C. They each return differently formatted strings and each behave differently for input and output depending on whether the actual column is char or varchar. Read the descriptions of the different types in the ESQL/C manual. For now, know that to get a space stripped, NULL terminated string you need to specify a host type of 'string' not char. Art S. Kagel ----- Original Message ----- From: Arnaud S <screen.cleaning@caramail.com> At: 8/ 4 5:48 > Hi ! > > I'm trying to do a simple select in a C program. > > First of all, the code : > > /* begin */ > exec sql include parameter.h; > /* code before */ > exec sql select valeur into :parameter.values > from parameter where code = :parameter.code; > /* code after */ > /* end */ > > In the include i've got : > /***************/ > struct parameter_ { > char code[31]; > char values[81]; > long range; > char information[81]; > long level; > char ddate[27]; > } parameter ; > /***************/ > > > when the code execute, all works fine except that in parameter.values i get: > "0 > " (to sum it up => 79 blanks after the value) > instead of only "0" > > > i've try to put various thing in the include , but the prepocessor is always > turning he declaration to char. > I know that when i 'm using test variables that i include directly in the source > code. > It works. > But the application that run on other database is using a large amount of > include for the struct. > > > So is there a parameters to only get the right number of character, or is there > a way (a simple way would be great since i've got to stay compatible with other > databases) to have this thing works ? > > > by advance, thank you ! > Arnaud