如何验证 oracle 数据库中的 SQL 查询语法?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30723387/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 02:53:58 来源:igfitidea点击:
How can I validate SQL query syntax in oracle database?
提问by Srinivas Ch
set NOEXEC ON;
Select * from emp;
Set NOEXEC OFF;
This validation is working in SQL Server. But It's not working in oracle.
此验证在 SQL Server 中有效。但它在 oracle 中不起作用。
Is there any syntax to check the query is valid or not in Oracle.
在 Oracle 中是否有任何语法来检查查询是否有效。
回答by sqluser
Using EXPLAIN PLAN
使用 EXPLAIN PLAN
EXPLAIN PLAN FOR SELECT FROM emp;
ERROR at line 1: ORA-00936: missing expression
第 1 行错误:ORA-00936:缺少表达式
EXPLAIN PLAN FOR SELECT * FROM emp;
Explained
解释