What does dbcancel() do?

What does dbcancel() do?

Post by James W. Melt » Sun, 20 Dec 1992 15:27:26



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).

 
 
 

What does dbcancel() do?

Post by David Van Couveri » Fri, 08 Jan 1993 14:00:48


[ stuff deleted... ]

Quote:>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).

dbcancel() cancels all the inserts that are part of the current
dbsqlexec().  dbcanquery would only cancel one of them (unless
the inserts were all part of a stored procedure).  In more exact
terms, dbcanquery() only cancels one set of results (equivalent
to one call to dbresults and then an empty dbnextrow loop).  
dbresults() cancesl all sets of results (equivalent to an empty
dbresults loop and an empty dbnextrow() loop).

David
--

David Van Couvering Sybase 1650 65th Street Emeryville, CA  94608
- Opinions expressed here are mine and not necessarily those of Sybase -

 
 
 

1. ADO thinks DBMS is done, but DBMS ain't done

I have 2 Recordsets on 2 different applications communicating with the same
database

-=The first Recordset is opened with=-
m_pGlobal_RS->Open(adCmd, m_pConnection.GetInterfacePtr(), adOpenKeyset,
adLockPessimistic, adCmdText);

-=The second Recordset is opened with=-
local_RS->Open(adCmd, m_pConnection.GetInterfacePtr(), adOpenKeyset,
adLockReadOnly, adCmdText);

* adCmd is a simple SELECT statement that is the SAME for both recordsets.

The code order is roughly this

Open m_pGlobal_RS
...
...
Change fields on m_pGlobal_RS
...
...
MoveNext on all rows of m_pGlobal_RS until EOF then MoveFirst  // since
pessimistic every row op sends update
..
..
I then fire an event to another application which opens local_RS.

It is random whether the data opened by the second RS is the pre-update data
or the post-update data. How can this be? I opened the connection
with the default  synchronous option, isn't this asynchronous behavior?

Thanks for the help,
-=Adog

2. Save 80% On Your Grocery Bills!!!

3. Trigger doing UNLOAD to file OR calling Store Procedure doing the UNLOAD to file

4. Calendar of USA Informix 7 Training Workshops

5. Caché from InterSystems - doing wh at other MV vendors should be doing

6. Changing a large number of records in a database over the Internet

7. Is this doing what I think it's doing?

8. Failed Scheduled DTS task Does Not Reschedule

9. Are We Doing A Deal Or Are We Doing A Deal ?

10. ASP - OLEDB Provider done yet login problem exsists

11. problem doing a restore

12. spaces in column names, when doing sql calls in java

13. Can this be done in one statement?