Notes about how to fix issues met when trying to run sqlcl
from git bash
on Windows
Running mintty v2.8.5 on a windows 10 machine.
$ uname -a
MINGW64_NT-10.0 my-machine-Id 2.10.0(0.325/5/3) 2018-04-23 03:21 x86_64 Msys
## Note: the command below will only work after the fix has been applied, actually
$ sql -v
SQLcl: Release 18.2.0.0 Production
## July 2018
add the path to sqlcl to $PATH
This is done by adding the following to env.sh (in C:\Program Files\Git\etc\profile.d)
## Add sqlcl to path
export PATH="/c/Program Files/sqlcl/bin:$PATH"
Following errors are displayed when running sql
command in git bash:
$ sql
/c/Program Files/sqlcl/bin/sql: line 197: [: /c/Program: binary operator expected
Error: Could not find or load main class oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli
Edit /c/Program Files/sqlcl/bin/sql
:
- Add a call to function
checkCygwin
right after the call tosetupClasspath
source
@@ -488,6 +489,7 @@ checkADE
setupArgs
setupSQLHome
setupClasspath
+checkCygwin
checkJavaLocation
- edit function
checkCygwin
so that mintty is detected:
@@ -216,6 +216,7 @@ function checkCygwin {
#
cygwin=false
case `uname` in
+ MINGW64*) cygwin=true;;
CYGWIN*) cygwin=true;;
esac
- (nice to have): edit check to support space characters in file path ( only needed if sqlcl is nested under a directory containing space characters, like
Program Files
:
@@ -194,7 +194,7 @@ function setupClasspath {
# directory under lib. These will be loaded
# at startup as well.
#
- if [ -f $SQL_HOME/cobertura.ser ]
+ if [ -f "$SQL_HOME/cobertura.ser" ]
then
- All the good things of bash.
- no crash when leaving (unlike powerShell, which crashes each time CTRL + C is pressed inside sql cli).
/NOLOG
option is not supported- Passwords are not hidden, they are displayed in clear text.
- broken layout when pressing on arrow-up key to retrieve last executed queries. query text starts to overlap with previously displayed contents
- Ctrl+L does not clear the screen
Conclusion: barely usable at the moment
Report problems to Oracle support. Need a specific access for this, apparently...
nolog works but you need to use
//NOLOG