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

相关推荐
何中应2 小时前
主流 OpenJDK 发行版下载安装
java·oracle·jdk·openjdk
Albert Tan14 小时前
Oracle EBS 外部应用节点-OOM
oracle·oracle ebs
一十九的酒17 小时前
Oracle 12c 标准版无缝升级企业版实战记录
数据库·oracle·标准版切换到企业版
2501_9423895520 小时前
特斯拉的车辆摄像头每四天为AI训练集采集的数据量
人工智能·hadoop·zookeeper·oracle·时序数据库·memcache
山峰哥1 天前
数据库工程与SQL优化实战指南‌
数据库·sql·oracle·深度优先·宽度优先
宠友信息1 天前
Spring Boot与异步审核构建仿小红书源码内容发布全流程
java·数据库·spring boot·redis·mysql·oracle·uni-app
—Miss. Z—1 天前
计算机二级MySQL选择题考点Ⅱ
数据库·mysql·oracle
Irene19911 天前
数据迁移,源端探查(以 Oracle 为例)的三种实现层次:工具化(MTK)、脚本化(最主流方式)和手工查询(测试学习)
oracle·数据迁移·源端探查
矜持的左手1 天前
硬件故障后数据文件大小不对故障处理—Oracle碎片扫描恢复
数据库·oracle
欢呼的太阳1 天前
数据库设计Step by Step (10)——范式化
服务器·数据库·oracle