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 脚本
基础教程推荐
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 在多列上分布任意行 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
