Is it possible to run a SQLPLUS script on a file encoded as UTF-8 with BOM

北城以北 提交于 2019-12-01 04:01:49

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.

This has been a bug open with Oracle for over 6 years now, but it doesn't look like they are interested in fixing it.

Their 'recommended workaround' (Doc ID 788156.1 Section C.6) is to strip the BOM or make your first script line a comment, and then ignore this error.

SP2-0042: unknown command "" - rest of line ignored.

Or

SP2-0734: unknown command beginning "-- Commen..." - rest of line ignored.

Bug 13515585 Details (requires OTN login):

Bug 13515585: ADD SUPPORT FOR THE UTF-8 BOM IN SQLPLUS
Bug Status: Internal (Oracle) Review 
Created: 19-Dec-2011 
Updated: 29-Sep-2015
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!