Re: trailing blank when selecting "char" into table with esql/c
Posted in 2003
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Data Types & Schema Design
Hi, Try to use sting insted of char data type. For example: struct parameter_ { string code[31]; string values[81]; long range; string potext[81]; long level; string ddate[27]; } parameter ; I hope this helpl you. Quique. At 15:36 04/08/2003 +0200, hobbes wrote: >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 sending to informix-list
Hi ! well it's my mistake. I took more time and now it's OK. Thank you for your answer... string is the solution :) One again Thk You Arnaud "Luis Enrique Feoli" <quifeoli@montevideo.com.uy> a 'crit dans le message de news: bgm29g$ive$1@terabinaries.xmission.com... > > > Hi, > > Try to use sting insted of char data type. > > For example: > struct parameter_ { > string code[31]; > string values[81]; > long range; > string potext[81]; > long level; > string ddate[27]; > } parameter ; > > I hope this helpl you. > > Quique.