Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server R、 调试包、调试(.Call)时出现SQL问题_Sql Server_R_Debugging - Fatal编程技术网

Sql server R、 调试包、调试(.Call)时出现SQL问题

Sql server R、 调试包、调试(.Call)时出现SQL问题,sql-server,r,debugging,Sql Server,R,Debugging,我正在尝试调试一个我认为在包中的错误。当我使用调试器单步执行代码时,有一段代码会产生我得到的错误 if (fetch == FALSE | nrow(data) < 1) { stat <- .Call("RODBCExecute", attr(channel, "handle_ptr"), data, as.integer(rows_at_time)) if (stat == -1L) { if (e

我正在尝试调试一个我认为在包中的错误。当我使用调试器单步执行代码时,有一段代码会产生我得到的错误

if (fetch == FALSE | nrow(data) < 1) {
        stat <- .Call("RODBCExecute", attr(channel, "handle_ptr"), 
            data, as.integer(rows_at_time))
        if (stat == -1L) {
            if (errors) {
                stop(paste0(RODBC::odbcGetErrMsg(channel), collapse = "\n"))
            }
            else {
                return(stat)
            }
        }
if(fetch==FALSE | nrow(data)<1){
StAt> p>您是正确的:调用(“THScCuffice”,…)调用由C/S C++函数加载的.so文件,它是C++声明中的TycCult.
<>我不想调试这个,你必须手工地通过C++源代码来弄清楚到底发生了什么,这不仅需要对一般C/C++的理解,而且需要对R的API(以及作者的编程风格)的深刻理解。.不想表现得粗鲁,但我猜如果你不熟悉.调用及其作用,你可能不熟悉R的API


更简单的第一步是准确地跟踪提供给此函数的内容,并尝试找出为什么它不是RODBCExecute所期望的。鉴于作者编写了一条错误消息,我会检查该错误消息是否有助于指出问题。我猜真正的错误发生得更早,并且这会导致ts在向RODBCExecute提供无效参数时出错。

感谢您的回复。我查看了提供给函数的内容。据我所知,对于
attr(通道,“handle_ptr”)
channel
是到SQL的连接名,而
是“handle_ptr”
是ODBC句柄的名称,
data
是我提供给
sqlExecute()的数据帧
RODBEXT
软件包中的
rows\u at\u time
有一个函数的默认设置。从错误的结果来看,光标状态有问题。我不确定光标状态是否与我的数据框有关,是否与SQL中的某些内容有关?SQL不是我的驾驶室,因此我在这方面没有帮助。我会的试着搜索产生的错误信息,但是我猜C++函数ROBCDCARCH没有错。