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

相关推荐
天人合一peng17 分钟前
kingbase数据库的
服务器·数据库·oracle
星火开发设计43 分钟前
关系代数:数据库查询的数学基石与实战解析
数据库·学习·oracle·知识·关系代数
ascarl20101 小时前
Oracle 12c 官方卸载工具 (Deinstall Tool) 标准流程
数据库·oracle
天码-行空1 小时前
Oracle 19c(19.3.0.0)完整安装教程(Windows+Linux双环境)
linux·运维·数据库·oracle
Filotimo_11 小时前
N+1查询问题
数据库·oracle
程序修理员19 小时前
oracle备份表还原
数据库·oracle
爬山算法1 天前
Hibernate(41)Hibernate的延迟加载和急加载的区别是什么?
java·oracle·hibernate
yangminlei1 天前
MySQL玩转数据可视化
数据结构·sql·oracle
知识分享小能手1 天前
Oracle 19c入门学习教程,从入门到精通,Oracle体系结构 —— 知识点详解(2)
数据库·学习·oracle
desert_xu1 天前
ORA-20079 错误栗子
数据库·oracle