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

  1. .Na "dbaltop" 
  2. .Aa
  3. .Fu
  4. Return the type of aggregate operator for a particular compute column.
  5. .Ih "compute column, returning type of aggregate operator"
  6. .Ih "aggregate operator, returning for a compute column"
  7. .Sy
  8. .Sf "int dbaltop(dbproc, computeid, column)"
  9. .Sp "DBPROCESS" "*dbproc"
  10. .Sp "int" "computeid"
  11. .Sp "int" "column"
  12. .Co
  13. .Bl
  14. This routine returns the type of aggregate operator for a particular column in a compute.
  15. For example, given the SQL statement:
  16. .SD
  17. .in +5n
  18. .ne 3
  19. select dept, name from employee
  20.     order by dept, name
  21.     compute count(name) by dept
  22. .in -5n
  23. .ED
  24. the call
  25. .I "dbaltop(dbproc, 1, 1)"
  26. will return the token value for 
  27. .I count
  28. since the 
  29. first aggregate operator in the first compute is a
  30. .I count.
  31. .Bl
  32. You can convert the token value to a readable token string with
  33. .I "dbprtype()."
  34. See the \f2dbprtype()\f1 manual page for a list of all token values and their
  35. equivalent token strings.
  36. .Bz
  37. .Pa
  38. .Pi dbproc
  39. A pointer to the DBPROCESS structure that provides the connection
  40. for a particular front-end/\*S process.  It contains all the
  41. information that \*L uses to manage communications and data between the
  42. front end and \*S.
  43. .Pi computeid
  44. The id that identifies the particular compute row of interest.
  45. A SQL SELECT statement may have multiple COMPUTE clauses, 
  46. each of which returns a separate compute row.
  47. The \f2computeid\f1 corresponding to the
  48. first COMPUTE clause in a SELECT is 1.
  49. The \f2computeid\f1 is returned by \f2dbnextrow()\f1 
  50. or \f2dbgetrow().\f1
  51. .Pi column
  52. The number of the column of interest.  The first column is number 1.
  53. .in -.375i
  54. .Re
  55. .br
  56. A token value for the
  57. type of the compute column's aggregate operator.
  58. .Sa
  59. dbadata,
  60. dbadlen,
  61. dbaltlen,
  62. dbnextrow,
  63. dbnumalts,
  64. dbprtype
  65.