home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer) / NeXT_Developer-3.3.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbaltlen.nr < prev    next >
Encoding:
Text File  |  1993-04-22  |  1.6 KB  |  63 lines

  1. .Na "dbaltlen" 
  2. .Aa
  3. .Fu
  4. Return the maximum length of the data for a particular compute column.
  5. .Ih "compute column, returning maximum length of data for a"
  6. .Sy
  7. .Sf "DBINT dbaltlen(dbproc, computeid, column)"
  8. .Sp "DBPROCESS" "*dbproc"
  9. .Sp "int" "computeid"
  10. .Sp "int" "column"
  11. .Co
  12. .Bl
  13. This routine returns the maximum length for a
  14. column in a compute row.
  15. In the case of variable length data,
  16. this is not necessarily the actual length of the data, but rather the
  17. maximum length. For the actual data length, use
  18. .I "dbadlen()."
  19. .sp
  20. For example, given the SQL statement:
  21. .SD
  22. .in +5n
  23. .ne 3
  24. select dept, name from employee
  25.     order by dept, name
  26.     compute count(name) by dept
  27. .in -5n
  28. .ED
  29. the call
  30. .I "dbaltlen(dbproc, 1, 1)"
  31. returns 4 because counts
  32. are of SYBINT4 type, which is 4 bytes long.
  33. .Bz
  34. .Pa
  35. .Pi dbproc
  36. A pointer to the DBPROCESS structure that provides the connection
  37. for a particular front-end/\*S process.  It contains all the
  38. information that \*L uses to manage communications and data between the
  39. front end and \*S.
  40. .Pi computeid
  41. The id that identifies the particular compute row of interest.
  42. A SQL SELECT statement may have multiple COMPUTE clauses, 
  43. each of which returns a separate compute row.
  44. The \f2computeid\f1 corresponding to the
  45. first COMPUTE clause in a SELECT is 1.
  46. The \f2computeid\f1 is returned by \f2dbnextrow()\f1 
  47. or \f2dbgetrow().\f1
  48. .Pi column
  49. The number of the column of interest.  The first column is number 1.
  50. .in -.375i
  51. .Re
  52. .br
  53. The maximum length, in bytes, possible for the data in a 
  54. particular compute column.  -1 is returned if there
  55. is no such column or COMPUTE clause.
  56. .Sa
  57. dbadata,
  58. dbadlen,
  59. dbalttype,
  60. dbgetrow,
  61. dbnextrow,
  62. dbnumalts
  63.