Forum Stats

  • 3,758,931 Users
  • 2,251,475 Discussions
  • 7,870,440 Comments

Discussions

UnsupportedEncodingException in SQLcl: Release 18.1.0.0 Production

User800507-Oracle
User800507-Oracle Member Posts: 28 Employee
edited Apr 13, 2018 9:30AM in SQLcl

Hi, when I start sql.exe I can connect to target. But when I try to run any query I got an UnsupportedEncodingException error. See below. In the sql.bat I could use -D parameters to fix the problem. How to fix it in sql.exe?

sql.exe scott/tiger

SQLcl: Release 18.1 Production on ┬ё ряЁ 08 10:06:11 2018

Copyright (c) 1982, 2018, Oracle.  All rights reserved.

Last Successful login time: ┬ё └яЁ 08 2018 10:06:13 +03:00

Connected to:

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> select 'x' from dual;

java.io.UnsupportedEncodingException: CL8MSWIN1251

        at java.lang.StringCoding.encode(Unknown Source)

        at java.lang.String.getBytes(Unknown Source)

        at oracle.dbtools.db.ResultSetFormatter.write(ResultSetFormatter.java:678)

        at oracle.dbtools.db.ResultSetFormatter.write(ResultSetFormatter.java:671)

        at oracle.dbtools.db.SQLPLUSCmdFormatter.rset2sqlplus(SQLPLUSCmdFormatter.java:2271)

        at oracle.dbtools.db.ResultSetFormatter.rset2sqlplus(ResultSetFormatter.java:314)

        at oracle.dbtools.db.ResultSetFormatter.rset2sqlplus(ResultSetFormatter.java:288)

        at oracle.dbtools.db.ResultSetFormatter.formatResults(ResultSetFormatter.java:149)

        at oracle.dbtools.db.ResultSetFormatter.formatResults(ResultSetFormatter.java:74)

        at oracle.dbtools.raptor.newscriptrunner.SQL.processResultSet(SQL.java:858)

        at oracle.dbtools.raptor.newscriptrunner.SQL.executeQuery(SQL.java:769)

        at oracle.dbtools.raptor.newscriptrunner.SQL.run(SQL.java:82)

        at oracle.dbtools.raptor.newscriptrunner.ScriptRunner.runSQL(ScriptRunner.java:407)

        at oracle.dbtools.raptor.newscriptrunner.ScriptRunner.run(ScriptRunner.java:233)

        at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:342)

        at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:225)

        at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.process(SqlCli.java:398)

        at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.processLine(SqlCli.java:409)

        at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.startSQLPlus(SqlCli.java:1235)

        at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.main(SqlCli.java:485)

SQL>

Answers

  • Glen Conway
    Glen Conway Member Posts: 859 Gold Badge
    edited Apr 10, 2018 12:13PM

    Not sure how to get sql.exe working in your environment, but did you notice the discussion on getting sql.bat back for the 18.1 release?

    sql.bat not found in sqlcl-18.1.0 download

  • Barry Mcgillin-Oracle
    Barry Mcgillin-Oracle Development Director Member Posts: 1,537 Employee
    edited Apr 13, 2018 9:30AM

    If you type

    SHOW ENCODING. or  SHOW ENCODINGS. you should see whats set and what is supported on your client.  Asa matter of interest, I see lots of encoding issues on your boiler plate sqlcl too.  What term encoding and territory settings do you have?

    SQL> show encoding

    Encoding:UTF-8

    SQL> show encodings

    current Encoding:UTF-8

    List of available encodings:

    Big5

    Big5-HKSCS

    CESU-8

    EUC-JP

    EUC-KR

    GB18030

    GB2312

    GBK

    IBM-Thai

    .... and oodles more

    x-SJIS_0213

    x-UTF-16LE-BOM

    X-UTF-32BE-BOM

    X-UTF-32LE-BOM

    x-windows-50220

    x-windows-50221

    x-windows-874

    x-windows-949

    x-windows-950

    x-windows-iso2022jp

    SQL>