home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / database / informix / 1907 < prev    next >
Encoding:
Text File  |  1992-09-09  |  1.2 KB  |  35 lines

  1. Newsgroups: comp.databases.informix
  2. Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsc!cbfsb!cbnews!cbnewsm!seeb
  3. From: seeb@cbnewsm.cb.att.com (Dick Seebach)
  4. Subject: Re: ESQL/C Question -- char or varchar columns padded?
  5. Organization: AT&T Bell Labs, Warren NJ
  6. Distribution: usa
  7. Date: Thu, 10 Sep 1992 11:45:22 GMT
  8. Message-ID: <1992Sep10.114522.5054@cbnewsm.cb.att.com>
  9. Keywords: char type, varchartype, strings not null terminated?
  10. References: <Sep.9.14.37.38.1992.23046@gauss.rutgers.edu>
  11. Sender:  Dick Seebach
  12. Lines: 21
  13.  
  14. In article <Sep.9.14.37.38.1992.23046@gauss.rutgers.edu> manmetha@gauss.rutgers.edu (Rajesh Malhotra) writes:
  15. >
  16. >Fellow Informix'ers,
  17. >
  18. >    In ESQL/C, when you retrieve a column of type char or varchar,
  19. >is the data padded with spaces at the end? Is there a way to 
  20. >retrieve NULL terminated strings like a normal C program would
  21. >expect?
  22. >
  23. >    Any and all responses appreciated,
  24.  
  25. For strings of type char (I don't use varchar), the strings retrieved
  26. are padded with spaces.
  27.  
  28. To avoid having strings padded, use the 'string' definition for
  29. the field; i.e.
  30.  
  31. string    filename[14];
  32.  
  33. This is documented in the RDSQL Data Types chapter of the
  34. ESQL/C Programmer's Manual for Version 2.10.
  35.