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

相关推荐
天空之城--9 小时前
Flutter Drift 完全指南:从原理到实战
jvm·flutter·oracle
奔跑吧树袋熊15 小时前
多租户隔离该做到哪一层:从连接池到 ORM 的取舍
开发语言·数据库·oracle·系统架构
YHHLAI16 小时前
从零理解 Agent Memory 管理:内存记忆、文件持久化与上下文截断
数据库·oracle
Aaron - Wistron17 小时前
Windows Server 配置
oracle
惜分飞18 小时前
记录一次0丢失的ORA-00354: 损坏重做日志块标头故障恢复---惜分飞
数据库·oracle
隔窗听雨眠18 小时前
Oracle TDE透明数据加密完全指南:从密钥库配置到生产运维的系统性实践
oracle·数据加密·tde
风哥2号1 天前
数据库教程FGMT13‑Oracle性能优化之数据仓库与分区表
数据库·oracle·性能优化
程序员清风1 天前
FastAPI 入门:用 Python 快速开发现代后端服务
python·oracle·fastapi
Zenova EdgeOS1 天前
工业网关数据持久化:从同步到 WAL 的工程实战
网络·数据库·oracle
oradh2 天前
Oracle UNDO 数据文件丢失处理(案例一)
数据库·oracle