home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 for Intel / NeXTSTEP 3.2 for Intel.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbcolsource.nr < prev    next >
Encoding:
Text File  |  1993-04-22  |  2.1 KB  |  71 lines

  1. .Na "dbcolsource"
  2. .mc |
  3. .Aa
  4. .Fu
  5. Return a pointer to the name of the database column from which the specified regular result 
  6. column was derived.
  7. .Ih "result column, returning database column corresponding to a"
  8. .Sy
  9. .Sf "char *dbcolsource(dbproc, colnum)"
  10. .Sp "DBPROCESS" "*dbproc"
  11. .Sp "int" "colnum"
  12. .Co
  13. .Bl
  14. \f2dbcolsource()\f1 is one of the \*L browse mode routines.
  15. It is usable only with results from a browse-mode SELECT (\f2i.e.,\f1
  16. a SELECT containing the key words FOR BROWSE).
  17. See the Introduction for a detailed discussion of browse mode.
  18. .Bl
  19. \f2dbcolsource()\f1 provides an application with information it needs to update
  20. a database column, based on an ad hoc query.
  21. SELECT statements may optionally specify header names for regular (\f2i.e.,\f1 non-compute)
  22. result columns:
  23. .SD
  24. .in +3n
  25. select author = au_lname from authors for browse
  26. .in -3n
  27. .ED
  28. When updating a table, you must use the database column name, not the header name
  29. (in this example, ``au_lname'', not ``author'').
  30. You can use the \f2dbcolsource()\f1 routine to get the underlying database column name:
  31. .SD
  32. .in +3n
  33. dbcolsource(dbproc, 1)
  34. .in -3n
  35. .ED
  36. This call will return a pointer to the string ``au_lname''.
  37. .Bl
  38. \f2dbcolsource()\f1 is useful for ad hoc queries.
  39. If the query has been hardcoded into the program, this routine is obviously unnecessary.
  40. .Bl
  41. The application can call
  42. \f2dbcolsource()\f1 any time after \f2dbresults()\f1.
  43. .Bl
  44. Example 7 in the \f2\*L Reference Supplement\f1 contains a call to \f2dbcolsource()\f1.
  45. .Bz
  46. .Pa
  47. .Pi dbproc
  48. A pointer to the DBPROCESS structure that provides the connection
  49. for a particular front-end/\*S process.  It contains all the
  50. information that \*L uses to manage communications and data between the
  51. front end and \*S.
  52. .Pi colnum
  53. The number of the result column of interest. Column numbers start at 1.
  54. .in -.375i
  55. .Re
  56. .br
  57. A pointer to a null-terminated column name. This pointer will be NULL
  58. if the column number is out of range or if the column is the result
  59. of a SQL expression, such as ``max(colname)''.
  60. .Sa
  61. dbcolbrowse,
  62. dbqual,
  63. dbtabbrowse,
  64. dbtabcount,
  65. dbtabname,
  66. dbtabsource,
  67. dbtsnewlen,
  68. dbtsnewval,
  69. dbtsput
  70. .mc
  71.