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