Is it possible to run SQLPLUS script in a file encoded as UTF-8 with specification

I am trying to run a set of scripts that were automatically generated from a large number of sources. Unfortunately, some of them were created as UTF-8 with BOM. I have a system for automatically deleting specifications, but this is a bit messy process.

Failure to delete the specification generates an error:

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

Is it possible to run SQLPLUS in a script file that has a specification?

+6
source share
2 answers

You can run SQLPLUS with such a script, but SQLPLUS will indicate an error in the first line due to the specification .
You probably wanted to ask if you can avoid this error - impossible , AFAIK. Erwin thinks so too.

You can trick any information by creating these files with an empty first line. Then you can simply ignore this error.

+4
source

This has been a bug open with Oracle for more than 6 years, but it looks like they don’t want to fix it.

Their recommended workaround ( Doc ID 788156.1 in section C.6) is to break the spec or make your first line of script comment, and then ignore this error.

SP2-0042: unknown command "βˆ©β•—β”" - the rest of the line is ignored.

or

SP2-0734: unknown start of the command "- Commen ..." - the rest of the line is ignored.

Error 13515585 Details (OTN registration required):

 Bug 13515585: ADD SUPPORT FOR THE UTF-8 BOM IN SQLPLUS Bug Status: Internal (Oracle) Review Created: 19-Dec-2011 Updated: 29-Sep-2015 
+3
source

Source: https://habr.com/ru/post/916688/


All Articles