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

相关推荐
小袁搬码3 小时前
PL/SQLDeveloper中数值类型字段查询后显示为科学计数法的处理方式
oracle·oracle数据库·pl.sqldeveloper
文牧之5 小时前
Oracle 审计参数:AUDIT_TRAIL 和 AUDIT_SYS_OPERATIONS
运维·数据库·oracle
betazhou8 小时前
有没有 MariaDB 5.5.56 对应 MySQL CONNECTION_CONTROL 插件
linux·数据库·mysql·oracle·mariadb
王小小鸭10 小时前
【Oracle APEX开发小技巧12】
数据库·oracle
远方160911 小时前
16-Oracle 23 ai-JSON-Relational Duality-知识准备
数据库·oracle·json
Wooden-Flute11 小时前
七、数据库的完整性
数据库·oracle
珹洺11 小时前
数据库系统概论(十七)超详细讲解数据库规范化与五大范式(从函数依赖到多值依赖,再到五大范式,附带例题,表格,知识图谱对比带你一步步掌握)
java·数据库·sql·安全·oracle
为中华崛起而奋斗13 小时前
Oracle 19c RAC集群ADG搭建
数据库·oracle
@小红花19 小时前
MySQL数据库从0到1
数据库·mysql·oracle
[听得时光枕水眠]20 小时前
MySQL基础(三)DQL(Data Query Language,数据查询语言)
数据库·mysql·oracle