本文介绍了如何使用SQL * Plus在create语句的中间创建带有空白行的视图/表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望通过脚本使用SQL * Plus创建一些视图,但是如果开发人员在中间声明中放置空白行,似乎会遇到问题.以下语句在TOAD/PL/SQL Developer等中正常运行,但在SQL * Plus中失败.(通常使用脚本编写,但是手动输入会产生完全相同的错误)
I wish to create some views using SQL*Plus via script, but seem to hit a problem if a developer has placed a blank line mid statement.The following statement works fine in TOAD / PL/SQL developer etc, but fails in SQL*Plus.(This is usually scripted, but entering it manually gives exactly the same error)
谁能告诉我为什么/如何阻止它?
Can anyone tell me why / how to stop it?
CREATE VIEW bob
AS
SELECT *
FROM DUAL;
具有SQL * Plus输出
With SQL*Plus output
SQL> CREATE VIEW bob
2 AS
3 SELECT *
4
SQL> FROM DUAL;
SP2-0042: unknown command "FROM DUAL" - rest of line ignored.
推荐答案
您将使用SET SQLBLANKLINES
命令:
SQL> SET SQLBLANKLINES on
SQL>
SQL> CREATE VIEW bob
2 AS
3 SELECT *
4
5 FROM DUAL;
View created
这篇关于如何使用SQL * Plus在create语句的中间创建带有空白行的视图/表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!