l ; 提示上次输入的sql 内容 如果去掉; sqlplus

Information in this document applies to any platform.

SYMPTOMS

You have a script that contains a SQL statement with two semicolons (;) at the end. Executing this script in SQL*Plus 8.0.6 shows only the queried records in the spooled output file. However, with SQL*Plus 10.2.x and higher, the spool output contains the actual SQL statement in addition to the queried records.

For Example:

Your script (call it mysql.sql) has the following code:

Select 'x' from dual;

;

Executing this script in SQL*Plus 10.2.x and higher yields output:

SQL> @mysql.sql

'

x

1* Select 'x' from dual

This includes the actual SQL statement, thus corrupting spooled output for further processing.

This was not seen in SQL*Plus 8.0.6 sqlplus. The output from SQL*Plus 8.0.6 yielded:

SQL> @mysql.sql

'

x

CHANGES

This is seen after migrating scripts from SQL*Plus 8.0.6 (usually part of E-Business Suite) to SQL*Plus 10.2.x and higher.

CAUSE

By Default, the semicolon ';' used as "Only character" on a line is interpreted as "show content of buffer". Buffer usually contains last executed SQL statement, thus it shows the SQL statement of the same script.

SOLUTION

To change behavior of ";" from "show buffer", you must set it as a Block terminator.

For Example, you set the following for BLOCKTERMINATOR in your SQL*Plus environment:

set blockterminator ';'

If it is required at script level, the script could be modified as:

set blockterminator ';'

select 'x' from dual;

;

set blockterminator off

相关推荐
大江东去浪淘尽千古风流人物18 分钟前
【DROID-W】WildGS-SLAM
数据库·人工智能·python·oracle·augmented reality
执笔画情ora43 分钟前
Oracle RAC数据库管理-hugePages大页内存配置
数据库·oracle
minebmw79 小时前
Oracle 19.29 中 ORA-00600 [4193] 错误完全解析与恢复指南
数据库·oracle
风子杨yxf77113 小时前
linux下oracle开机自启动以及关机自关闭数据库,并发送邮件通知
linux·运维·数据库·oracle·自启动·发邮件·自关闭
数厘16 小时前
2.18 sql排序查询(ORDER BY、ASC、DESC)
数据库·sql·oracle
oradh20 小时前
Oracle数据库完整性约束概述
数据库·oracle·数据库基础·数据库入门·oracle数据完整性·oracle数据库约束类型
IT邦德20 小时前
Update Advisor:Oracle MAA架构下数据库补丁管理
数据库·oracle·架构
oradh1 天前
Oracle数据库索引簇表和哈希簇表概述
oracle·哈希算法·oracle基础·oracle数据库基础·索引簇表·哈希簇表
minebmw71 天前
Oracle 19.29 中 ORA-00600 [4000] 错误完全解析
数据库·oracle
战族狼魂1 天前
40x40 矩阵控制系统
jvm·oracle·矩阵