Forum Stats

  • 3,757,165 Users
  • 2,251,204 Discussions
  • 7,869,747 Comments

Discussions

sqlcl 18 how to access jython as scripting engine

Bill S3
Bill S3 Member Posts: 19
edited Jan 10, 2019 11:07AM in SQLcl

downloaded jython-standalone-2.7.0.jar

tried

set CLASS=C:\Users\A6001746\PycharmProjects\sqlcl\lib\jython-standalone-2.7.0.jar

SQL

SQL> cd sqlcl

SQL> script helloworld.py

Could not load Scripting Engine for :py

SQL>

Thanks

Best Answer

  • Gaz in Oz
    Gaz in Oz Member Posts: 3,782 Bronze Crown
    edited Jan 10, 2019 12:42AM Accepted Answer

    sqlcl version?

    How are you starting sqlcl?

    You will need to call java and sqlcl jar libraries directly with a sql.bat, which does make use of CLASSPATH, available in lower versions of sqlcl.

    sql.exe does not make use of the %CLASSPATH% variable.

    Search this forum for "sql.bat" as there are people who reported and fixed the Errors in sql.bat 17.4.0.354.2224

    and made it "work" with later releases of sqlcl 18+, thus giving usable functionality with %CLASSPATH%.

    For example:

    The last version of sqlcl I successfully setup to use jython-standaolne-2.7.0.jar was

       SQLcl: Release 17.4.0.354.2224

    which was shipped with

       sqldeveloper-17.4.1.054.0712

    ...and using the sql.bat shipped with that and commenting out the erroneous lines, the set DEBUG line and adding "setlocal" to the header.

    There may be other ways to get jython working in what ever release of sqlcl you are currently using, or there may be none.

Answers

  • Bill S3
    Bill S3 Member Posts: 19
    edited Jan 8, 2019 8:59PM

    CLASS was really CLASSPATH I copied it wrong

  • Gaz in Oz
    Gaz in Oz Member Posts: 3,782 Bronze Crown
    edited Jan 10, 2019 12:42AM Accepted Answer

    sqlcl version?

    How are you starting sqlcl?

    You will need to call java and sqlcl jar libraries directly with a sql.bat, which does make use of CLASSPATH, available in lower versions of sqlcl.

    sql.exe does not make use of the %CLASSPATH% variable.

    Search this forum for "sql.bat" as there are people who reported and fixed the Errors in sql.bat 17.4.0.354.2224

    and made it "work" with later releases of sqlcl 18+, thus giving usable functionality with %CLASSPATH%.

    For example:

    The last version of sqlcl I successfully setup to use jython-standaolne-2.7.0.jar was

       SQLcl: Release 17.4.0.354.2224

    which was shipped with

       sqldeveloper-17.4.1.054.0712

    ...and using the sql.bat shipped with that and commenting out the erroneous lines, the set DEBUG line and adding "setlocal" to the header.

    There may be other ways to get jython working in what ever release of sqlcl you are currently using, or there may be none.