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

  1. .Na "dbchange" 
  2. .Aa
  3. .Fu
  4. Determine whether a command batch has changed the current database.
  5. .Ih "database, determining whether it has changed"
  6. .Sy
  7. .Sf "char *dbchange(dbproc)"
  8. .Sp "DBPROCESS" "*dbproc"
  9. .Co
  10. .Bl
  11. \f2dbchange()\f1 informs the program of a change in the current database.
  12. It does so by catching any instance of the \*N USE command.
  13. .Bl
  14. Although a USE command can appear anywhere in a command batch, the
  15. database change does not actually take effect until the end of the batch.
  16. \f2dbchange()\f1 is therefore
  17. useful only in determining whether the current command batch has changed
  18. the database for subsequent command batches.
  19. .Bl
  20. The internal DBPROCESS flag that \f2dbchange()\f1 monitors to determine whether
  21. the database has changed is cleared when the program executes a new command batch
  22. by calling either 
  23. .I "dbsqlexec()"
  24. or
  25. .I "dbsqlsend()."
  26. Therefore, the simplest way to keep track of database changes is to call
  27. \f2dbchange()\f1 when \f2dbresults()\f1 returns NO_MORE_RESULTS
  28. at the end of each command batch.
  29. .Bl
  30. Alternatively, you can always get the name of the current database by calling
  31. .I "dbname()."
  32. .Bz
  33. .Pa
  34. .Pi dbproc
  35. A pointer to the DBPROCESS structure that provides the connection
  36. for a particular front-end/\*S process.  It contains all the
  37. information that \*L uses to manage communications and data between the
  38. front end and \*S.
  39. .in -.375i
  40. .Re
  41. .br
  42. A pointer to the null-terminated name of the new database, if any.
  43. If the database has not changed, NULL will be returned.
  44. .Sa
  45. dbname,
  46. dbresults,
  47. dbsqlexec,
  48. dbsqlsend,
  49. dbuse
  50.