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

  1. .Na "dbnumalts" 
  2. .Aa
  3. .Fu
  4. Return the number of columns in a compute row.
  5. .Ih "compute row, number of columns in"
  6. .Sy
  7. .Sf "int dbnumalts(dbproc, computeid)"
  8. .Sp "DBPROCESS" "*dbproc"
  9. .Sp "int" "computeid"
  10. .Co
  11. .Bl
  12. .I "dbnumalts()"
  13. returns the number of columns in a compute row.
  14. The application can call this routine after
  15. .I "dbresults()"
  16. returns SUCCEED.
  17. For example, given the SQL statement:
  18. .SD
  19. .in +5n
  20. .ne 3
  21. select dept, year, sales from employee
  22.     order by dept, year
  23.     compute avg(sales), min(sales), max(sales) by dept
  24. .in -5n
  25. .ED
  26. the call
  27. .I "dbnumalts(dbproc, 1)"
  28. will return 3.
  29. .Bz
  30. .Pa
  31. .Pi dbproc
  32. A pointer to the DBPROCESS structure that provides the connection
  33. for a particular front-end/\*S process.  It contains all the
  34. information that \*L uses to manage communications and data between the
  35. front end and \*S.
  36. .Pi computeid
  37. The id that identifies the particular compute row of interest.
  38. A SQL SELECT statement may have multiple COMPUTE clauses, 
  39. each of which returns a separate compute row.
  40. The \f2computeid\f1 corresponding to the
  41. first COMPUTE clause in a SELECT is 1.
  42. The \f2computeid\f1 is returned by \f2dbnextrow()\f1 
  43. or \f2dbgetrow().\f1
  44. .in -.375i
  45. .Re
  46. .br
  47. The number of columns for the particular 
  48. .I "computeid".
  49. \f2dbnumalts()\f1 returns -1 if 
  50. .I "computeid"
  51. is invalid.
  52. .Sa
  53. dbadata,
  54. dbadlen,
  55. dbaltlen,
  56. dbalttype,
  57. dbgetrow,
  58. dbnextrow,
  59. dbnumcols
  60.