Is it possible to run a SQLPLUS script on a file encoded as UTF-8 with BOM(是否可以在编码为带有 BOM 的 UTF-8 的文件上运行 SQLPLUS 脚本)
问题描述
我正在尝试运行从大量来源自动生成的脚本集合.不幸的是,其中一些已生成为带有 BOM 的 UTF-8.我有一个自动删除 BOM 的系统,但它的过程有点混乱.
I'm trying to run a collection of scripts which have been auto-generated from a large number of sources. Unfortunately some of these have been generated as UTF-8 with BOM. I have in place a system for automatically removing the BOM, but its a bit of a messy process.
未能移除 BOM 会产生错误:
Failing to remove the BOM generates the error:
SP2-0042: unknown command "" - rest of line ignored.
是否可以在具有 BOM 的脚本文件上运行 SQLPLUS?
Is it possible to run SQLPLUS on a script file which has a BOM?
推荐答案
用这样的脚本运行 SQLPLUS 是可能的,但 SQLPLUS 会在第一行提示错误,因为 物料清单.
可能您想问是否可以避免此错误 - 不可能,AFAIK.Erwin 也这么认为.
It is possible to run SQLPLUS with such script, but SQLPLUS will indicate an error on the first line because of BOM.
Probably you wanted to ask if you can avoid this error - it is not possible, AFAIK. Erwin thinks so too.
您可以通过生成第一行为空的文件来解决丢失任何信息的问题.那么你可以忽略这个错误.
You can workaround losing any information by generating those files with an empty first line. Then you can just ignore this error.
这篇关于是否可以在编码为带有 BOM 的 UTF-8 的文件上运行 SQLPLUS 脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:是否可以在编码为带有 BOM 的 UTF-8 的文件上运行 SQLPLUS 脚本


基础教程推荐
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01