Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
要将外部库支持取消处理这一情况通知给数据库服务器,外部库必须导出以下函数:
extern "C" void SQL_CALLBACK extfn_cancel( void *cancel_handle );
cancel_handle 指向要操纵的变量的指针。
无论何时取消当前正在执行的 SQL 语句,数据库服务器都会异步调用此函数。
函数使用 cancel_handle 设置一个标志,来将 SQL 语句已取消这一情况通知外部库函数。
如果不通过库导出该函数,则数据库服务器就会认为取消处理是不被支持的。
此函数的典型实现方式如下:
extern "C" void SQL_CALLBACK extfn_cancel( void *cancel_handle ) { *(short *)cancel_handle = 1; }