Forum Stats

  • 3,752,281 Users
  • 2,250,483 Discussions
  • 7,867,775 Comments

Discussions

NLS settings corrected, but does not work (SQLcl)

2881746
2881746 Member Posts: 6
edited Jan 26, 2018 10:10AM in SQLcl

Hi all,

I have some difficulties to change language from default to ENGLISH.

Oracle registry NLS_LANG is ENGLISH,

Windows NLS_LANG variable is ENGLISH too.

login.sql script corrected accordingly: System.setProperty("user.lang","en");

All tests show en:us and [american_america.WE8ISO8859P15], but message language is still not ENGLISH, see log file below please.

If I try to change it by JAVA_TOOL_OPTIONS='-Duser.language=en -Duser.region=US'  -- it is accepted, but connect is not possible: "Error Message = Locale not recognized"

Any idea?

Best regards,

Sergey

=====================================

C:\Local\DB\Tickets\180123>sql.bat

C:\Local\DB\Tickets\180123>rem set JAVA_TOOL_OPTIONS='-Duser.language=en -Duser.region=US -Dfile.encoding=UTF-8'

C:\Local\DB\Tickets\180123>rem set JAVA_TOOL_OPTIONS='-Duser.language=en -Duser.region=US -Dfile.encoding=WE8MSWIN1252'

C:\Local\DB\Tickets\180123>set JAVA_TOOL_OPTIONS='-Duser.language=en -Duser.region=US'

C:\Local\DB\Tickets\180123>C:\Progs\sqlcl\bin\sql.exe test/[email protected]:1521/DB1STA.sixt.de

Picked up JAVA_TOOL_OPTIONS: '-Duser.language=en -Duser.region=US'

SQLcl: Release 17.4.0 Production on Tue Jan 23 14:14:56 2018

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

  USER          = test

  URL           = jdbc:oracle:oci8:@puma02:1521/DB1STA.sixt.de

  Error Message = Incompatible version of libocijdbc[Jdbc:122010, Jdbc-OCI:121020

  USER          = test

  URL           = jdbc:oracle:thin:@puma02:1521/DB1STA.sixt.de

  Error Message = Locale not recognized

Username? (RETRYING) ('test/*********@puma02:1521/DB1STA.sixt.de'?)

  USER          = test

  URL           = jdbc:oracle:oci8:@puma02:1521/DB1STA.sixt.de

  Error Message = Incompatible version of libocijdbc[Jdbc:122010, Jdbc-OCI:121020

  USER          = test

  URL           = jdbc:oracle:thin:@puma02:1521/DB1STA.sixt.de

  Error Message = Locale not recognized

Username? (RETRYING) ('test/*********@puma02:1521/DB1STA.sixt.de'?)

-- ==== without language settings it is connected, but wuth default system language:

C:\Local\DB\Tickets\180123>sql.bat

C:\Local\DB\Tickets\180123>C:\Progs\sqlcl\bin\sql.exe test/[email protected]:1521/DB1STA.sixt.de

SQLcl: Release 17.4.0 Production auf Di Jan 23 14:28:02 2018

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

Last Successful login time: Di Jan 23 2018 14:28:07 +01:00

Verbunden mit:

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

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Advanced Analytics and Real Application Testing options

login.sql wurde in CWD gefunden. Der DB-Zugriff ist f++r login.sql eingeschr+ñnkt.

Passen Sie SQLPATH an, um den Pfad f++r eine umfassende Funktionalit+ñt einzuschlie+ƒen.

en

us

TEST @ puma02:1521/DB1STA.sixt.de >

TEST @ db1sta >alias ls=SELECT object_name FROM user_objects;

TEST @ db1sta >ls

Keine Zeilen gew+ñhlt

TEST @ db1sta >show java

Java Detail

-----------

java.home= C:\Program Files\Java\jre1.8.0_161

java.vendor= Oracle Corporation

java.vendor.url= http://java.oracle.com/

java.version= 1.8.0_161

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

----------

os.arch= amd64

os.name= Windows 10

os.version= 10.0

path.separator= ;

file.separator= \

line.separator=

user.dir= C:\Local\Scripts\SQLCL

user.home= C:\Users\S3414

user.name= S3414

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

----------

Classpath=

C:\Progs\sqlcl\bin\sql.exe;C:\Progs\sqlcl\bin\..\lib\.;C:\Progs\sqlcl\bin\..\lib\..;C:\Progs\sqlcl\bin\..\lib\antlr-runtime.jar;C:\Progs\sqlcl\bin\..\lib\commons-codec.jar;C:\Progs\sqlcl\bin

\..\lib\c

ommons-logging.jar;C:\Progs\sqlcl\bin\..\lib\httpclient.jar;C:\Progs\sqlcl\bin\..\lib\httpcore.jar;C:\Progs\sqlcl\bin\..\lib\httpmime.jar;C:\Progs\sqlcl\bin\..\lib\jackson-annotations.jar;C:

\Progs\sql

cl\bin\..\lib\jackson-core.jar;C:\Progs\sqlcl\bin\..\lib\jackson-databind.jar;C:\Progs\sqlcl\bin\..\lib\javax.json.jar;C:\Progs\sqlcl\bin\..\lib\jline.jar;C:\Progs\sqlcl\bin\..\lib\jsch.jar;

C:\Progs\s

qlcl\bin\..\lib\ojdbc8.jar;C:\Progs\sqlcl\bin\..\lib\oracle.dbtools-common.jar;C:\Progs\sqlcl\bin\..\lib\oracle.dbtools.http.jar;C:\Progs\sqlcl\bin\..\lib\oracle.dbtools.jdbcrest.jar;C:\Prog

s\sqlcl\bi

n\..\lib\oracle.sqldeveloper.sqlcl.jar;C:\Progs\sqlcl\bin\..\lib\oraclepki.jar;C:\Progs\sqlcl\bin\..\lib\orai18n-collation.jar;C:\Progs\sqlcl\bin\..\lib\orai18n-mapping.jar;C:\Progs\sqlcl\bi

n\..\lib\o

rai18n-servlet.jar;C:\Progs\sqlcl\bin\..\lib\orai18n-utility.jar;C:\Progs\sqlcl\bin\..\lib\orai18n.jar;C:\Progs\sqlcl\bin\..\lib\orajsoda.jar;C:\Progs\sqlcl\bin\..\lib\osdt_cert.jar;C:\Progs

\sqlcl\bin

\..\lib\osdt_core.jar;C:\Progs\sqlcl\bin\..\lib\stringtemplate.jar;C:\Progs\sqlcl\bin\..\lib\xdb6.jar;C:\Progs\sqlcl\bin\..\lib\xmlparserv2.jar;C:\Progs\sqlcl\bin\..\modules\oracle.xdk\xmlpa

rserv2.jar

;C:\Progs\sqlcl\bin\..\rdbms\jlib\xdb6.jar;C:\Progs\sqlcl\bin\..\jlib\orai18n-mapping.jar

;C:\Progs\sqlcl\bin\..\jlib\orai18n.jar;C:\Progs\sqlcl\bin\..\jdbc\lib\ojdbc6.jar;C:\Progs\sqlcl\bin\..\jdbc\lib\ojdbc7.jar;C:\Progs\sqlcl\bin\..\jdbc\lib\ojdbc8.jar;C:\Progs\sqlcl\bin\..\jl

ib\orai18

n-utility.jar

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-- ==== login.sql:

set termout off

define gname=idle

column global_name new_value gname

select lower(user)||'@' ||substr(global_name,1,decode(dot,0,length(global_name),dot-1)) global_name from (select global_name, instr(global_name,'.') dot from global_name);

set sqlprompt '&gname>'

set termout on

set linesize 200

set pagesize 100

column VALUE_COL_PLUS_SHOW_PARAM format A65

column NAME_COL_PLUS_SHOW_PARAM  format A40

set sqlprompt "_user '@' _connect_identifier >"

script

  var System  = Java.type("java.lang.System");

  System.setProperty("user.lang","en");

  System.setProperty("user.country","us");

  System.out.println( System.getProperty("user.lang"));

  System.out.println(  System.getProperty("user.country"));

/

-- ====

C:\Local\DB\Tickets\180126>sql.bat

C:\Local\DB\Tickets\180126>rem to change language

C:\Local\DB\Tickets\180126>rem set JAVA_TOOL_OPTIONS='-Duser.language=en -Duser.region=US -Dfile.encoding=UTF-8'

C:\Local\DB\Tickets\180126>rem set JAVA_TOOL_OPTIONS='-Duser.language=en -Duser.region=US'

C:\Local\DB\Tickets\180126>rem set LANG=en_US.UTF-8

C:\Local\DB\Tickets\180126>rem to suppress extra empty lnes

C:\Local\DB\Tickets\180126>rem SET STD_ARGS=-Djava.awt.headless=true -Xss10M -Dfile.encoding=UTF-8

C:\Local\DB\Tickets\180126>C:\Progs\sqlcl\bin\sql.exe /nolog

SQLcl: Release 17.4.0 Production auf Fr Jan 26 12:48:11 2018

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

en  <<<<<<<<<<<<<<<<<<<<< !!!!!

us

>@.[%NLS_LANG%]

Fehler beim Start in Zeile: 1 in Befehl -

@.[%NLS_LANG%]

Fehlerbericht -

SP2-0310: +ûffnen von Datei nicht m+Âglich: ".[american_america.WE8ISO8859P15]"

>

C:\Local\DB\Tickets\180123>sql.batC:\Local\DB\Tickets\180123>rem set JAVA_TOOL_OPTIONS='-Duser.language=en -Duser.region=US -Dfile.encoding=UTF-8'C:\Local\DB\Tickets\180123>rem set JAVA_TOOL_OPTIONS='-Duser.language=en -Duser.region=US -Dfile.encoding=WE8MSWIN1252'C:\Local\DB\Tickets\180123>set JAVA_TOOL_OPTIONS='-Duser.language=en -Duser.region=US'
C:\Local\DB\Tickets\180123>C:\Progs\sqlcl\bin\sql.exe test/[email protected]:1521/DB1STA.sixt.dePicked up JAVA_TOOL_OPTIONS: '-Duser.language=en -Duser.region=US'
SQLcl: Release 17.4.0 Production on Tue Jan 23 14:14:56 2018
Copyright (c) 1982, 2018, Oracle.  All rights reserved.
  USER          = test  URL           = jdbc:oracle:oci8:@puma02:1521/DB1STA.sixt.de  Error Message = Incompatible version of libocijdbc[Jdbc:122010, Jdbc-OCI:121020  USER          = test  URL           = jdbc:oracle:thin:@puma02:1521/DB1STA.sixt.de  Error Message = Locale not recognizedUsername? (RETRYING) ('test/*********@puma02:1521/DB1STA.sixt.de'?)  USER          = test  URL           = jdbc:oracle:oci8:@puma02:1521/DB1STA.sixt.de  Error Message = Incompatible version of libocijdbc[Jdbc:122010, Jdbc-OCI:121020  USER          = test  URL           = jdbc:oracle:thin:@puma02:1521/DB1STA.sixt.de  Error Message = Locale not recognizedUsername? (RETRYING) ('test/*********@puma02:1521/DB1STA.sixt.de'?)

-- ==== But without language settings it is connected, but wuth default system language:
C:\Local\DB\Tickets\180123>sql.batC:\Local\DB\Tickets\180123>C:\Progs\sqlcl\bin\sql.exe test/[email protected]:1521/DB1STA.sixt.de
SQLcl: Release 17.4.0 Production auf Di Jan 23 14:28:02 2018
Copyright (c) 1982, 2018, Oracle. All rights reserved. Alle Rechte vorbehalten.
Last Successful login time: Di Jan 23 2018 14:28:07 +01:00
Verbunden mit:Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,Advanced Analytics and Real Application Testing options
login.sql wurde in CWD gefunden. Der DB-Zugriff ist f++r login.sql eingeschr+ñnkt.Passen Sie SQLPATH an, um den Pfad f++r eine umfassende Funktionalit+ñt einzuschlie+ƒen.enus
TEST @ puma02:1521/DB1STA.sixt.de >
TEST @ db1sta >alias ls=SELECT object_name FROM user_objects;TEST @ db1sta >lsKeine Zeilen gew+ñhlt


TEST @ db1sta >show javaJava Detail-----------java.home= C:\Program Files\Java\jre1.8.0_161java.vendor= Oracle Corporationjava.vendor.url= http://java.oracle.com/java.version= 1.8.0_161--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------os.arch= amd64os.name= Windows 10os.version= 10.0path.separator= ;file.separator= \line.separator=
user.dir= C:\Local\Scripts\SQLCLuser.home= C:\Users\S3414user.name= S3414--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Classpath=C:\Progs\sqlcl\bin\sql.exe;C:\Progs\sqlcl\bin\..\lib\.;C:\Progs\sqlcl\bin\..\lib\..;C:\Progs\sqlcl\bin\..\lib\antlr-runtime.jar;C:\Progs\sqlcl\bin\..\lib\commons-codec.jar;C:\Progs\sqlcl\bin\..\lib\commons-logging.jar;C:\Progs\sqlcl\bin\..\lib\httpclient.jar;C:\Progs\sqlcl\bin\..\lib\httpcore.jar;C:\Progs\sqlcl\bin\..\lib\httpmime.jar;C:\Progs\sqlcl\bin\..\lib\jackson-annotations.jar;C:\Progs\sqlcl\bin\..\lib\jackson-core.jar;C:\Progs\sqlcl\bin\..\lib\jackson-databind.jar;C:\Progs\sqlcl\bin\..\lib\javax.json.jar;C:\Progs\sqlcl\bin\..\lib\jline.jar;C:\Progs\sqlcl\bin\..\lib\jsch.jar;C:\Progs\sqlcl\bin\..\lib\ojdbc8.jar;C:\Progs\sqlcl\bin\..\lib\oracle.dbtools-common.jar;C:\Progs\sqlcl\bin\..\lib\oracle.dbtools.http.jar;C:\Progs\sqlcl\bin\..\lib\oracle.dbtools.jdbcrest.jar;C:\Progs\sqlcl\bin\..\lib\oracle.sqldeveloper.sqlcl.jar;C:\Progs\sqlcl\bin\..\lib\oraclepki.jar;C:\Progs\sqlcl\bin\..\lib\orai18n-collation.jar;C:\Progs\sqlcl\bin\..\lib\orai18n-mapping.jar;C:\Progs\sqlcl\bin\..\lib\orai18n-servlet.jar;C:\Progs\sqlcl\bin\..\lib\orai18n-utility.jar;C:\Progs\sqlcl\bin\..\lib\orai18n.jar;C:\Progs\sqlcl\bin\..\lib\orajsoda.jar;C:\Progs\sqlcl\bin\..\lib\osdt_cert.jar;C:\Progs\sqlcl\bin\..\lib\osdt_core.jar;C:\Progs\sqlcl\bin\..\lib\stringtemplate.jar;C:\Progs\sqlcl\bin\..\lib\xdb6.jar;C:\Progs\sqlcl\bin\..\lib\xmlparserv2.jar;C:\Progs\sqlcl\bin\..\modules\oracle.xdk\xmlparserv2.jar;C:\Progs\sqlcl\bin\..\rdbms\jlib\xdb6.jar;C:\Progs\sqlcl\bin\..\jlib\orai18n-mapping.jar;C:\Progs\sqlcl\bin\..\jlib\orai18n.jar;C:\Progs\sqlcl\bin\..\jdbc\lib\ojdbc6.jar;C:\Progs\sqlcl\bin\..\jdbc\lib\ojdbc7.jar;C:\Progs\sqlcl\bin\..\jdbc\lib\ojdbc8.jar;C:\Progs\sqlcl\bin\..\jlib\orai18n-utility.jar----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- ==== login.sql:set termout offdefine gname=idlecolumn global_name new_value gnameselect lower(user)||'@' ||substr(global_name,1,decode(dot,0,length(global_name),dot-1)) global_name from (select global_name, instr(global_name,'.') dot from global_name);set sqlprompt '&gname>'set termout onset linesize 200set pagesize 100column VALUE_COL_PLUS_SHOW_PARAM format A65column NAME_COL_PLUS_SHOW_PARAM  format A40
set sqlprompt "_user '@' _connect_identifier >"
script  var System  = Java.type("java.lang.System");  System.setProperty("user.lang","en");  System.setProperty("user.country","us");  System.out.println( System.getProperty("user.lang"));  System.out.println(  System.getProperty("user.country"));/
-- ====C:\Local\DB\Tickets\180126>sql.bat
C:\Local\DB\Tickets\180126>rem to change language
C:\Local\DB\Tickets\180126>rem set JAVA_TOOL_OPTIONS='-Duser.language=en -Duser.region=US -Dfile.encoding=UTF-8'
C:\Local\DB\Tickets\180126>rem set JAVA_TOOL_OPTIONS='-Duser.language=en -Duser.region=US'
C:\Local\DB\Tickets\180126>rem set LANG=en_US.UTF-8
C:\Local\DB\Tickets\180126>rem to suppress extra empty lnes
C:\Local\DB\Tickets\180126>rem SET STD_ARGS=-Djava.awt.headless=true -Xss10M -Dfile.encoding=UTF-8
C:\Local\DB\Tickets\180126>C:\Progs\sqlcl\bin\sql.exe /nolog
SQLcl: Release 17.4.0 Production auf Fr Jan 26 12:48:11 2018
Copyright (c) 1982, 2018, Oracle. All rights reserved. Alle Rechte vorbehalten.
en  <<<<<<<<<<<<<<<<<<<<< !!!!!us
>@.[%NLS_LANG%]
Fehler beim Start in Zeile: 1 in Befehl [email protected][%NLS_LANG%]Fehlerbericht -SP2-0310: +ûffnen von Datei nicht m+Âglich: ".[american_america.WE8ISO8859P15]" >

Gaz in Oz

Best Answer

  • Gaz in Oz
    Gaz in Oz Member Posts: 3,778 Bronze Crown
    edited Jan 26, 2018 8:32AM Accepted Answer
    <random number> wrote:login.sql script corrected accordingly: System.setProperty("user.lang","en");

    You'll need more lines than that in your login.sql to successfully run javascript to try and set the language:

    SQLcl 4.2 - Set the language of the help text

    ...

    script   var System = Java.type("java.lang.System");   System.setProperty("user.lang","en");   System.setProperty("user.country","us");   System.out.println(System.getProperty("user.lang"));   System.out.println(System.getProperty("user.country"));/

    Lines 5 and 6 are just to show what the properties have been set to so are optional.

Answers

  • Gaz in Oz
    Gaz in Oz Member Posts: 3,778 Bronze Crown
    edited Jan 26, 2018 8:32AM Accepted Answer
    <random number> wrote:login.sql script corrected accordingly: System.setProperty("user.lang","en");

    You'll need more lines than that in your login.sql to successfully run javascript to try and set the language:

    SQLcl 4.2 - Set the language of the help text

    ...

    script   var System = Java.type("java.lang.System");   System.setProperty("user.lang","en");   System.setProperty("user.country","us");   System.out.println(System.getProperty("user.lang"));   System.out.println(System.getProperty("user.country"));/

    Lines 5 and 6 are just to show what the properties have been set to so are optional.

  • 2881746
    2881746 Member Posts: 6
    edited Jan 26, 2018 8:30AM

    Hi Gaz,

    exactly, as published above login.sql content, but did not help.

    Best regards,

    Sergey

  • Gaz in Oz
    Gaz in Oz Member Posts: 3,778 Bronze Crown
    edited Jan 26, 2018 9:23AM
    exactly, as published above login.sql content, but did not help.

    ok, so how about adding:

    set JAVA_TOOL_OPTIONS=-Duser.language=en -Duser.region=US -Dfile.encoding=UTF-8

    to your sql.bat file... to pass these settings directly to JVM  so sqlcl picks them up from there.

  • 2881746
    2881746 Member Posts: 6
    edited Jan 26, 2018 8:45AM

    Yes, login.sql content is permanent.

    but with JAVA_TOOL_OPTIONS connect is not possible.

    Without JAVA_TOOL_OPTIONS - connected, but language is GERMAN.

  • Gaz in Oz
    Gaz in Oz Member Posts: 3,778 Bronze Crown
    edited Jan 26, 2018 9:24AM

    Now I'm confused. you seem to be using sql.bat and sql.exe.

    At the command prompt:

    set JAVA_TOOL_OPTIONS=-Duser.language=en -Duser.region=USset LANG=en_US.UTF-8set NLS_LANG=AMERICAN_AMERICA.UTF8sql.exe -s /NOLOG

    Once in sqlcl:

    set fubarconnect youruser/[email protected] 'x' from nowhere;

    ...so we can see an ORA- error and a sqlcl error from sql.exe

    Copy/Paste the output back here using "Advanced editor" and courier new font.

  • 2881746
    2881746 Member Posts: 6
    edited Jan 26, 2018 9:36AM

    With pleasure:

    C:\Local\DB\Tickets\180126>sql.bat                                                                                                                           

                                                                                                                                                                 

    C:\Local\DB\Tickets\180126>set JAVA_TOOL_OPTIONS='-Duser.language=en -Duser.region=US'                                                                       

                                                                                                                                                                 

    C:\Local\DB\Tickets\180126>set LANG=en_US.UTF-8                                                                                                              

                                                                                                                                                                 

    C:\Local\DB\Tickets\180126>set NLS_LANG=AMERICAN_AMERICA.UTF8                                                                                                

                                                                                                                                                                 

    C:\Local\DB\Tickets\180126>C:\Progs\sqlcl\bin\sql.exe /nolog                                                                                                 

    Picked up JAVA_TOOL_OPTIONS: '-Duser.language=en -Duser.region=US'                                                                                           

                                                                                                                                                                 

    SQLcl: Release 17.4.0 Production on Fri Jan 26 15:25:29 2018                                                                                                 

                                                                                                                                                                 

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

                                                                                                                                                                 

    en                                                                                                                                                           

    us                                                                                                                                                           

                                                                                                                                                                 

    >connect test/[email protected]                                                                                                                                

      USER          = test                                                                                                                                       

      URL           = jdbc:oracle:oci8:@db1sta                                                                                                                   

      Error Message = Incompatible version of libocijdbc[Jdbc:122010, Jdbc-OCI:121020                                                                            

      USER          = test                                                                                                                                       

      URL           = jdbc:oracle:thin:@(DESCRIPTION =    (ADDRESS = (PROTOCOL = TCP)(HOST = scan-pumaha1)(PORT = 1521))    (CONNECT_DATA =      (SERVICE_NAME = d

    b1sta.sixt.de)    )  )                                                                                                                                       

      Error Message = Locale not recognized                                                                                                                      

                                                                                                                                                                 

    Jan 26, 2018 3:25:48 PM oracle.dbtools.raptor.newscriptrunner.ScriptExecutor run                                                                             

    SEVERE: oracle.dbtools.raptor.scriptrunner.commands.NLSLANGListener.setLanguage(NLSLANGListener.java:86)                                                     

    java.lang.NullPointerException                                                                                                                               

            at oracle.dbtools.raptor.scriptrunner.commands.NLSLANGListener.setLanguage(NLSLANGListener.java:86)                                                  

            at oracle.dbtools.raptor.scriptrunner.commands.NLSLANGListener.runOnConnect(NLSLANGListener.java:52)                                                 

            at oracle.dbtools.raptor.scriptrunner.commands.NLSLANGListener.endEvent(NLSLANGListener.java:102)                                                    

            at oracle.dbtools.raptor.newscriptrunner.CommandRegistry.fireEndListeners(CommandRegistry.java:568)                                                  

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

            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:390)                                                                        

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

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

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

                                                                                                                                                                 

    >set fubar                                                                                                                                               

    SP2-0158: unknown SET option "fubar"                                                                                                                         

    >select 'x' from nowhere;                                                                                                                                

    SP2-0640: Not connected                                                                                                                                      

    -- ==== But without JAVA_TOOL_OPTIONS it is connected, but with GERMAN language:

    C:\Local\DB\Tickets\180126>sql.bat                                                       

                                                                                             

    C:\Local\DB\Tickets\180126>set LANG=en_US.UTF-8                                          

                                                                                             

    C:\Local\DB\Tickets\180126>set NLS_LANG=AMERICAN_AMERICA.UTF8                            

                                                                                             

    C:\Local\DB\Tickets\180126>C:\Progs\sqlcl\bin\sql.exe /nolog                             

                                                                                             

    SQLcl: Release 17.4.0 Production auf Fr Jan 26 15:30:29 2018                             

                                                                                             

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

                                                                                             

    en                                                                                       

    us                                                                                       

                                                                                             

    >set fobar                                                                           

    SP2-0158: Unbekannte SET-Option "fobar"                                                  

    >connect test/[email protected]                                                            

    Angemeldet.                                                                              

    login.sql wurde in CWD gefunden. Der DB-Zugriff ist f├╝r login.sql eingeschr├ñnkt.       

    Passen Sie SQLPATH an, um den Pfad f├╝r eine umfassende Funktionalit├ñt einzuschlie├ƒen. 

    en                                                                                       

    us                                                                                       

    TEST @ db1sta >select 'x' from nowhere;                                                  

                                                                                             

    Fehler beim Start in Zeile: 1 in Befehl -                                                

    select 'x' from nowhere                                                                  

    Fehler bei Befehlszeile: 1 Spalte: 17                                                    

    Fehlerbericht -                                                                          

    SQL-Fehler: ORA-00942: table or view does not exist                                      

    00942. 00000 -  "table or view does not exist"                                           

    *Cause:                                                                                  

    *Action:                                                                                 

  • Gaz in Oz
    Gaz in Oz Member Posts: 3,778 Bronze Crown
    edited Jan 26, 2018 10:04AM

    You didn't use the -s option for sql.exe.

    There is a horrendous amount of white noise in your output.

    set JAVA_TOOL_OPTIONS='-Duser.language=en -Duser.region=US' 

    That looks wrong. Lose the quotes around the string.

      >set fubar                                                                                                                                                SP2-0158: unknown SET option "fubar"                                                                                                                            >select 'x' from nowhere;                                                                                                                                 SP2-0640: Not connected

    You didn't connect to a db before running the broken select.

    ... so you didn't copy and paste what I posted to run in your new cmd console.

  • 2881746
    2881746 Member Posts: 6
    edited Jan 26, 2018 10:04AM

    Many thanks, without quotation it works proper!

    C:\Local\DB\Tickets\180126>set JAVA_TOOL_OPTIONS=-Duser.language=en -Duser.region=US                                                                                           

    C:\Local\DB\Tickets\180126>set LANG=en_US.UTF-8                                                                                                                                

    C:\Local\DB\Tickets\180126>set NLS_LANG=AMERICAN_AMERICA.UTF8                                                                                                                  

    C:\Local\DB\Tickets\180126>C:\Progs\sqlcl\bin\sql.exe /nolog                                                                                                                   

    Picked up JAVA_TOOL_OPTIONS: -Duser.language=en -Duser.region=US                                                                                                               

                                                                                                                                                                                   

    SQLcl: Release 17.4.0 Production on Fri Jan 26 16:00:23 2018                                                                                                                   

                                                                                                                                                                                   

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

                                                                                                                                                                                   

    en                                                                                                                                                                             

    us                                                                                                                                                                             

                                                                                                                                                                                   

    >connect test/[email protected]                                                                                                                                                  

    Connected.                                                                                                                                                                     

    login.sql found in the CWD. DB access is restricted for login.sql.                                                                                                             

    Adjust the SQLPATH to include the path to enable full functionality.                                                                                                           

    en                                                                                                                                                                             

    us                                                                                                                                                                             

    TEST @ db1sta >set fobar                                                                                                                                                       

    SP2-0158: unknown SET option "fobar"                                                                                                                                           

    TEST @ db1sta >select 'x' from nowhere;                                                                                                                                        

                                                                                                                                                                                   

    Error starting at line : 1 in command -                                                                                                                                        

    select 'x' from nowhere                                                                                                                                                        

    Error at Command Line : 1 Column : 17                                                                                                                                          

    Error report -                                                                                                                                                                 

    SQL Error: ORA-00942: table or view does not exist                                                                                                                             

    00942. 00000 -  "table or view does not exist"                                                                                                                                 

    *Cause:                                                                                                                                                                        

    *Action:                                                                                                                                                                       

    Gaz in Oz
  • Gaz in Oz
    Gaz in Oz Member Posts: 3,778 Bronze Crown
    edited Jan 26, 2018 10:10AM

    Happy to hear you got it sorted.