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

  1. .Na "dbuse" 
  2. .Aa
  3. .Fu
  4. Use a particular database.
  5. .Ih "database, setting the"
  6. .Sy
  7. .Sf "RETCODE dbuse(dbproc, dbname)"
  8. .Sp "DBPROCESS" "*dbproc"
  9. .Sp "char" "*dbname"
  10. .Co
  11. .Bl
  12. This routine issues a \*N USE command for the 
  13. specified database for a particular DBPROCESS.
  14. It sets up the command and calls
  15. .I "dbsqlexec()"
  16. and 
  17. .I "dbresults()."
  18. .Bl
  19. If the USE command fails because the requested database 
  20. has not yet completed a recovery process,
  21. \f2dbuse()\f1 will continue to send USE commands at one
  22. second intervals until it either succeeds or encounters
  23. some other error.
  24. .Bl
  25. The routine uses the
  26. .I dbproc
  27. provided by the caller.  It also uses the command buffer of
  28. that
  29. .I dbproc.
  30. \f2dbuse()\f1 overwrites
  31. any existing commands in the buffer and clears the buffer
  32. when it is finished.
  33. .Bz
  34. .Pa
  35. .Pi dbproc
  36. A pointer to the DBPROCESS structure that provides the connection
  37. for a particular front-end/\*S process.  It contains all the
  38. information that \*L uses to manage communications and data between the
  39. front end and \*S.
  40. .Pi dbname
  41. The name of the database to use.
  42. .in -.375i
  43. .Re
  44. .br
  45. SUCCEED or FAIL.
  46. .Sa
  47. dbchange,
  48. dbname
  49.