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

相关推荐
TheRouter16 分钟前
AI Agent 记忆体系建设实战:短期、长期与工作记忆的工程实现
数据库·人工智能·oracle
JAVA面经实录9171 小时前
Hibernate面试题库
数据库·oracle·hibernate
jnrjian5 小时前
CDB 中某个PDB的datafile 丢失 没有备份过也可恢复 需要来回切换CDB PDB
oracle
zandy10117 小时前
衡石科技 NL2Metrics 技术深度解析(2026):ChatBI 准确度破局的关键路径
数据库·科技·oracle
Java小白笔记7 小时前
Linux 手动部署 Oracle JDK 17 完全指南
java·linux·oracle
anew___7 小时前
《数据库原理》精要解读(三)—— SQL:与数据库对话的艺术
数据库·sql·oracle
六月雨滴10 小时前
Oracle RMAN 安全与加密
安全·oracle·dba
曹牧11 小时前
Oracle:UNIX时间戳
数据库·oracle·unix
DarkAthena13 小时前
【ORACLE】添加短信以外的双因素认证方式
oracle
Irene199113 小时前
Oracle(字符集分为服务端和客户端) 和 Hive(依赖 MySQL(或 PostgreSQL)存储元数据)字符集编码格式查询,中文乱码处理
hive·sql·oracle