是否可以在使用BOM编码为UTF-8的文件上运行SQLPLUS脚本 [英] Is it possible to run a SQLPLUS script on a file encoded as UTF-8 with BOM

查看:236
本文介绍了是否可以在使用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,但是由于 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脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆