首页 \ 问答 \ 有没有办法确定SQL Server存储过程返回记录集(Is there any way of determining of a SQL Server Stored Procedure returns a recordset)

有没有办法确定SQL Server存储过程返回记录集(Is there any way of determining of a SQL Server Stored Procedure returns a recordset)

我们有一个内部应用程序,它生成ASP代码来调用Oracle和SQL存储过程。

该应用程序查询相应的数据字典,并能够确定参数信息,并相应地构建调用。 使用此应用程序的开发人员可以在其项目中包含代码,并使用专用DTO(也由应用程序生成)将数据传递给它。

在Oracle中,我们可以愉快地确定是否返回记录集,因为我们使用了refcursors,并且这些记录显示在Oracle DDL的参数列表中。

对于SQL Server,情况并非如此。 目前,开发人员必须知道SQL Server SP是否返回记录集,并在界面上勾选一个选项。 反过来,这将确定代码生成是否包含ExecuteQueryExecuteNonQuery

虽然这没关系,但是选择这个选项会很好。 有没有办法通过检查数据字典或其他方式以编程方式确定?

谢谢,

詹姆士


We have an internal application which generates ASP code to call Oracle and SQL Stored procedures.

This application queries the respective data dictionaries, and is able to determine parameter information, and construct the call accordingly. A developer using this application can include the code in their project, and pass data to it using a dedicated DTO (also generated by the app).

In Oracle, we can happily determine if a recordset is returned, as we use refcursors, and these show up in the parameter list on the Oracle DDL.

This not the case for for SQL Server. Currently the developers themselves have to know whether the SQL Server SP returns a recordset, and tick an option on the interface. This, in turn, determines whether the code generates contains ExecuteQuery or ExecuteNonQuery.

While this is ok, it would be nice no to have that option. Is there a way that his can be determined programatically by inspecting the data dictionary or by some other means?

Thanks,

James


原文:https://stackoverflow.com/questions/4874265
更新时间:2023-06-05 12:06

最满意答案

我建议摆脱TestFunctions.h ,并将Test::count()的实现添加到Test.cpp 。 目前, TestFunctions.h头文件并不包含在任何地方,所以你无法访问main的定义。


I would suggest getting rid of TestFunctions.h, and adding the implementation of Test::count() to Test.cpp. Currently, the TestFunctions.h header is not included anywhere, so you have no access to the definition from main.

相关问答

更多
  • 如果我在Class2.cpp中包含#include "Burrito.cpp" ,那么它可以工作,但他没有包含它。 这很少(我会说永远不会)解决方案。 不要#include在其他源文件中应该是源文件。 解决方案是编译您需要编译的所有文件,并让链接器处理链接问题。 你没有编译Burrito.cpp,所以当然你有链接问题。 解决方案很简单:编译Burrito.cpp并将Burrito.o添加到您提供给链接器的文件集中。 或者,您可以向编译器提供Class2.cpp和Burrito.cpp,从而创建可执行文件而不 ...
  • 假设你单身人士是Calculation类,你是否缺少getInstance调用? utils.Calculation.getInstance().setResult(2, 1); 一个好的动作单例模式: package com.stackOverflow { public class MySingleton { public function MySingleton(lock:Class) { if(lock != Singleton ...
  • 在定义 .cpp文件中的字段时,不应使用static关键字,只有在类中声明时才使用。 请注意代码注释中有“声明”和“定义”错误的方式。 另外,在定义成员时,您需要使用类名称对其进行限定。 所以.cpp定义应该是: MyTest::DBGL MyTest::debug_level_d = MyTest::FULL; 通过在定义中使用static关键字,可以将其限制为内部链接。 请参阅: http : //en.cppreference.com/w/cpp/language/static You should ...
  • 我建议摆脱TestFunctions.h ,并将Test::count()的实现添加到Test.cpp 。 目前, TestFunctions.h头文件并不包含在任何地方,所以你无法访问main的定义。 I would suggest getting rid of TestFunctions.h, and adding the implementation of Test::count() to Test.cpp. Currently, the TestFunctions.h header is not i ...
  • 我不认为专业类模板从非专用类模板继承方法实现的概念是正确的。 考虑例如std :: enable_if。 此类的全部内容是通过引用模板的特定版本中不存在的类型来触发替代失败。 如果您描述的行为是正确的,那么这将无效。 或者至少,您需要使用两个特化而不是泛型和一个特化来定义enable_if(事实并非如此)。 我认为这是一个“XY”的情况:你希望能够做一些事情,但我认为你更有可能修改你的设计,所以你不需要做那件事。 我可以想象获得通用模板成员函数会有用的情况,但它应该是相对罕见的,这不会让我觉得这些情况之一。 ...
  • 你已经声明了默认的构造函数(CombatAdmin()),从而阻止了编译器自动生成它。 因此,您需要1)从类中移除默认构造函数的声明,或者2)提供一个实现。 You have declared the default constructor (CombatAdmin()) and thus prevented the compiler from automatically generating it. Thus, you either need to 1) remove declaration of the ...
  • 首先实例化一个实例,并确保在目标文件中有一个非extern的g_myClass定义。 Instantiate an instance first, and make sure that you have a non-extern definition of g_myClass among your object files.
  • 您的cpp文件中不应包含Class。 他们看起来应该更像: BinomialNode.cpp #include "BinomialNode.h" BinomialNode::BinomialNode(int n) : k(0) { data = n; } 当然,更长的BinomialTree.cpp的必然结果。 此外,您应该使用以下内容编译它: g++ BinomialTree.cpp BinomialNode.cpp Asg5.cpp -o asg5 你的代码也会遇到很多其他问题。 例如: ...
  • 该错误是由于在B和C析构函数中调用A::decompose引起的。 即使析构函数是虚拟的并且方法本身是虚拟的,也会调用A::decompose 。 当为派生对象B或C运行析构函数时,对象的派生部分已被销毁。 class A { public: virtual void decompose() { std::cout << "A";} virtual ~A() { decompose(); } }; class B:public A { private: int *b_data; p ...
  • 改变这一行: @magazine.pages.create(image: image, page_number: @pages + index + 1) 至 @magazine.pages.create(image: image, page_number: @pages.page_number || 0 + index + 1) change this line: @magazine.pages.create(image: image, page_number: @pages + index + 1) ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。