home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / database / sybase / 520 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  1.5 KB

  1. Path: sparky!uunet!spool.mu.edu!uwm.edu!cs.utexas.edu!ut-emx!shrike!flash
  2. From: flash@austin.lockheed.com (James W. Melton)
  3. Newsgroups: comp.databases.sybase
  4. Subject: What does dbcancel() do?
  5. Message-ID: <1420@shrike.com>
  6. Date: 19 Dec 92 06:27:26 GMT
  7. Organization: "Lockheed Austin Division, 6800 Burleson Rd, Austin, TX 78744
  8. Lines: 32
  9.  
  10. Would someone please clarify this for me?
  11.  
  12. I have a table which is populated by a program which reads a data
  13. source, decodes the data, and calls stored procedures to do the
  14. inserts. The following source fragment is relavent:
  15.  
  16.     dbcmd(dbproc, "exec insert_data");
  17.     /* other dbfcmd calls omitted */
  18.  
  19.     dbsqlexec(dbproc);
  20.  
  21.     while ((result = dbresults(dbproc)) != NO_MORE_RESULTS)
  22.     {
  23.         while (dbnextrow(dbproc) != NO_MORE_ROWS)
  24.         {
  25.         }
  26.     }
  27.  
  28. Note that the inner while loop is empty. However, this basic
  29. construct is what you find in TFM and sample programs. Now I know
  30. that I can replace the inner loop with dbcanquery(), and the
  31. documentation hints that I can replace the outter loop with
  32. dbcancel(), but I am not sure.
  33.  
  34. dbcancel() says that it sends a signal to the server to stop
  35. processing the current command batch and discard any results. Since
  36. I am just doing inserts, I don't really care about the results.
  37. However, I am not sure what delimits the "current" command batch,
  38. and I might not want to cancel THAT.
  39.  
  40. Does anyone KNOW how this works? Particularly if the command batch
  41. DOES contain several statements (all INSERTs in this case).
  42.