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

相关推荐
fen_fen17 分钟前
人大金仓数据库kingbase8创建表示例
数据库·oracle
Oracle NetSuite10 小时前
制造行业ERP如何选型?拥抱云端预算新时代
科技·oracle·制造·系统·erp
JuneXcy11 小时前
第2章 数据库系统的核心--数据模型
数据库·mysql·oracle
火星MARK12 小时前
RAID详解
数据库·oracle
安审若无13 小时前
Oracle 打补丁指南
数据库·oracle
❥ღ Komo·15 小时前
PHP数据库操作全攻略
数据库·oracle
yumgpkpm1 天前
华为鲲鹏 Aarch64 环境下多 Oracle 、mysql数据库汇聚到Cloudera CDP7.3操作指南
大数据·数据库·mysql·华为·oracle·kafka·cloudera
学编程的董1 天前
07 计算字段的创建与使用 - 数据转换的艺术
数据库·oracle
大气层煮月亮1 天前
Oracle EBS ERP开发——报表生成Excel标准模板设计
数据库·oracle·excel
云和数据.ChenGuang1 天前
达梦数据库的命名空间
数据库·oracle