trailing blank when selecting "char" into table with esql/c
Posted in 2003
Hi ! I have this problem and i cannot find any information about it , so that why i m doing my first post ! I'm processing an application from oracle, sqllsever,Ingres , ect .... to Informix. It's a big part of C code with esql/c in it. Sharper than an explanation , an example : /* My program */ exec sql include parametre.h; /* cut cut cut */ exec sql select valeur into :parameter.values from parametre where code = :parameter.code; /* continues........*/ The include ************** struct parameter_ { char code[31]; char values[81]; long range; char potext[81]; long level; char ddate[27]; } parameter ; All our tables use the same technique => they are declared as structure and are called by the include . The problem is that i get this result => "0 " . (to sum it up "0" and 80 blank after) instead of just getting "0" I 've tried to use varchar or else in the include, but the prepocessor just turn them back to char. .. >>> So my question : is there a way to not have all these blanks ? (most of our columns are varchar) <<< I 'm trying to stay as non specific as possible. So, (and yes i'm not very conciliant :) ) i'm not for using procedures or so (but if there is no other solution) and i can't (this time it's not my fault) had function to the queries such as trim, since there is almost 300000 lines of codes in C and almost 10000 queries and many programs that are used in parallel. Yes i could try but 1) it will be specific and 2) it will be long..... :) Thank you for having read this message :) and thank you by advance for any answers ! Arnaud