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

相关推荐
Leon-Ning Liu8 小时前
当SGA大于hugepage的时候,Oracle数据库是怎么使用hugepage的
数据库·oracle
尋有緣10 小时前
力扣614-二级关注者
大数据·数据库·sql·oracle
小宇的天下14 小时前
Calibre DESIGNrev DRC/LVS启动和准备文件(10-1)
服务器·数据库·oracle
hopsky18 小时前
SQL语义校验方案
数据库·oracle
一个天蝎座 白勺 程序猿18 小时前
破局困境:Oracle迁移金仓KingbaseES数据库的深度实践
数据库·sql·oracle·kingbase·kingbasees·金仓数据库
Ashley_Amanda18 小时前
各种视图类型的创建方法和区别
数据库·oracle
程序员水自流18 小时前
MySQL常用SQL语法及参数详细介绍(新手经验书)
java·数据库·sql·mysql·oracle
勇往直前plus1 天前
MyBatis/MyBatis-Plus类型转换器深度解析:从基础原理到自定义实践
数据库·oracle·mybatis
·云扬·1 天前
MySQL分页查询优化:从基础到进阶实践
数据库·mysql·oracle
川贝枇杷膏cbppg1 天前
oracle的trace,alert,incident,cdump,hm都是干嘛的
数据库·oracle