如何使用 VBSCRIPT 从包含临时表中的值的存储过程访问数据?
出于测试目的,我编写了一个 VBscript,它将通过执行包含临时表中的值的存储过程来从 Sybase 获取值。当我运行脚本时,我收到以下错误,
"Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record."
或者
"Item cannot be found in the collection corresponding to the requested name or ordinal."
当我在谷歌搜索时我发现,当我们在存储过程中使用临时表时,将显示上述错误消息,如果这是原因,那么我如何通过访问数据VBscript通过执行存储过程?? 我正在使用 QTP 运行 VBScript
for testing purpose I wrote a VBscript which will fetch values from Sybase by executing a stored procedure which contains values in temp table. When I run the script I get the following errors ,
"Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record."
or
"Item cannot be found in the collection corresponding to the requested name or ordinal."
Somewhere when I was googling I found that , the above error message will be shown when we use temp table in stored procedure, if that is the reason , then how can I access data via VBscript by executing the stored procedure ??
I am using QTP to run VBScript
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也不了解 Sybase,但听起来您返回的记录集要么具有与您期望的不同的字段名称,要么甚至不存在。
我假设您正在插入临时表,然后最终从中选择以返回值。
如果 sybase 支持,请在存储过程的开头使用 Set NOCOUNT On。
您可能会取回多个记录集,而第一个记录集不是您想要的。
I don't know Sybase as well but it sounds like the recordset you return either has field names different than what you are expecting OR its not even there.
I assume you are inserting into the temp table and then eventually selecting from it to return the values.
If sybase supports it, use a Set NOCOUNT On at the beginning of your stored proc.
You likely are getting multiple recordsets back and the first one isn't the one you want.