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.connector 禁用查询缓存 2022-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 是否可以执行按位分组功能? 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
- 无法解决整理冲突 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
