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

  1. .Na "dbadlen" 
  2. .Aa
  3. .Fu
  4. Return the actual length of the data for a compute column.
  5. .Ih "compute column, length of data in"
  6. .Sy
  7. .Sf "DBINT dbadlen(dbproc, computeid, column)"
  8. .Sp "DBPROCESS" "*dbproc"
  9. .Sp "int" "computeid"
  10. .Sp "int" "column"
  11. .Co
  12. .Bl
  13. This routine returns the actual length of the data for a particular compute column.
  14. .Bl
  15. Use the \f2dbaltlen()\f1 routine to determine the maximum possible length for the data.
  16. Use \f2dbadata()\f1 to get a pointer to the data.
  17. .Bl
  18. Here's a program fragment that illustrates the use of \f2dbadlen()\fP:
  19. .ta +4n +4n +4n +4n +4n +4n
  20. .SD
  21. .so dbadlen.ex
  22. .ED
  23. .Bz
  24. .Pa
  25. .Pi dbproc
  26. A pointer to the DBPROCESS structure that provides the connection
  27. for a particular front-end/\*S process.  It contains all the
  28. information that \*L uses to manage communications and data between the
  29. front end and \*S.
  30. .Pi computeid
  31. The id that identifies the particular compute row of interest.
  32. A SQL SELECT statement may have multiple COMPUTE clauses, 
  33. each of which returns a separate compute row.
  34. The \f2computeid\f1 corresponding to the
  35. first COMPUTE clause in a SELECT is 1.
  36. The \f2computeid\f1 is returned by \f2dbnextrow()\f1 
  37. or \f2dbgetrow().\f1
  38. .Pi column
  39. The number of the column of interest.  The first column is number 1.
  40. .in -.375i
  41. .Re
  42. .br
  43. The length, in bytes, of the data for a particular compute column.  
  44. If there is no such column or COMPUTE clause,
  45. \f2dbadlen()\f1 returns -1.
  46. If the data has a null value,
  47. .I "dbadlen()"
  48. returns 0.
  49. .Sa
  50. dbadata,
  51. dbaltlen,
  52. dbalttype,
  53. dbgetrow,
  54. dbnextrow,
  55. dbnumalts
  56.