Skip to Main Content

SQLcl

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to run a js script with arguments on one line?

GasparYYCOct 30 2024

Hi everyone
I have a question: I would like to run in a bash script a SQLcl call in just one line, currently I can only run it interactively and works fine (using windows WSL):

This is the run how I run the script format.js. First, I log in to SQLcl then run the script command with the two arguments:

/Documents/Apps/sqlcl-24.3.0.285.0530/sqlcl/bin/sql.exe /nolog

SQLcl: Release 24.3 Production on Wed Oct 30 14:31:55 2024
Copyright (c) 1982, 2024, Oracle. All rights reserved.

SQL> script format.js ../../CF-DB/appX/functions/APPROVAL_NUMBER.fnc

Formatting file 1 of 1: ..\..\CF-DB\appX\functions\APPROVAL_NUMBER.fnc... done.
SQL>

What I would like is to run is all in one line so I can run it in a bash script, currently it fails with “Bad Filename”:

cd /git/plsql-formatter-settings/sqlcl
/Documents/Apps/sqlcl-24.3.0.285.0530/sqlcl/bin/sql.exe /nolog script format.js ../../CF-DB/appX/functions/APPROVAL_NUMBER.fnc 

Bad Filename : format.js

Oracle SQL Developer Command-Line (SQLcl) help

Usage 1: sql -H | -V

    -H             Displays the SQLcl version and the
                   usage help.
    -V             Displays the SQLcl version.
.....

Does anyone have any ideas?

Thanks!

Comments
Post Details
Added on Oct 30 2024
2 comments
109 views