What are all the possible first-words of SQL statements?(SQL 语句的所有可能的第一个单词是什么?)
问题描述
我正在构建一个用户界面,以便能够在 SQL Server 数据库上执行 SQL 语句,与 SQL Server 2008 R2 兼容.我需要能够确定每个语句是否可能返回一个数据集,或者它是否只需要执行.在 Delphi 中,TADOQuery
由数据集的 Open
/Close
或仅用于执行的 ExecSQL
组成.我需要根据 SQL 语句的第一个单词自动确定使用哪个.
I'm building a user interface to be able to execute SQL statements on a SQL Server database, compatibility at SQL Server 2008 R2. I need to be able to determine whether each statement could possibly return a dataset, or if it just needs to be executed. In Delp the TADOQuery
consists of either Open
/ Close
for a dataset, or ExecSQL
just to execute. I need to automatically determine which one to use based on the first word(s) of the SQL statement.
如何根据语句中的第一个单词确定应该调用哪个方法?我需要知道每个可能的单词,以及基于每个单词的方法.
How can I determine which method I should call based on the first word(s) in the statement? I would need to know each possible word, and which method based on each word.
推荐答案
这在一般意义上是不可能的.例如,EXEC 存储过程名称可以返回结果集或不返回结果集,具体取决于 proc 的编写方式.仅从调用的语法无法知道是其中一个还是另一个.
That is not possible in the general sense. EXEC stored-procedure-name for example can eithers return a result set or not, depending on how the proc is written. There is no way to know if it's one or the other just from the syntax of the call.
这篇关于SQL 语句的所有可能的第一个单词是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:SQL 语句的所有可能的第一个单词是什么?


基础教程推荐
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 在多列上分布任意行 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- oracle区分大小写的原因? 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01