Path: utzoo!utgpu!watserv1!watmath!att!pacbell.com!mips!prls!pyramid!infmx!davek From: davek@informix.com (David Kosenko) Newsgroups: comp.databases Subject: Re: Informix question, character columns Message-ID: <1990Nov29.160003.2951@informix.com> Date: 29 Nov 90 16:00:03 GMT References: <1990Nov28.110715.22247@lth.se> Sender: news@informix.com (Usenet News) Organization: Informix Software, Inc. Lines: 28 In article <1990Nov28.110715.22247@lth.se> jh@efd.lth.se (Joergen Haegg) writes: > >Is it possible to have null-terminated character strings >in a character column? The ESQL/C manual mention that it is possible. >But my strings gets filled with spaces up to the length of the column. > >Is there a way to do this? Yes. You want to declare your host variables as type string, e.g. $string foo[25]; When you fetch or select into a host variable declared as type string, no blank-padding will occur and the string will be null-terminated. If the string seleted is longer than the host variable size, it will contain n-1 (where n is the size of the string variable) characters and the null character, and, if used, the indicator variable will be set to indicate that truncation occurred. Dave Kosenko Informix Client Services -- Disclaimer: These opinions make no sense and should be ignored! ************************************************************************** The heart and the mind on a parallel course, never the two shall meet. -E. Saliers