Discussions
Categories
- 385.5K All Categories
- 5.1K Data
- 2.5K Big Data Appliance
- 2.5K Data Science
- 453.4K Databases
- 223.2K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 47 Multilingual Engine
- 606 MySQL Community Space
- 486 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.2K ORDS, SODA & JSON in the Database
- 584 SQLcl
- 4K SQL Developer Data Modeler
- 188K SQL & PL/SQL
- 21.5K SQL Developer
- 46 Data Integration
- 46 GoldenGate
- 298.4K Development
- 4 Application Development
- 20 Developer Projects
- 166 Programming Languages
- 295K Development Tools
- 150 DevOps
- 3.1K QA/Testing
- 646.7K Java
- 37 Java Learning Subscription
- 37.1K Database Connectivity
- 201 Java Community Process
- 108 Java 25
- 22.2K Java APIs
- 138.3K Java Development Tools
- 165.4K Java EE (Java Enterprise Edition)
- 22 Java Essentials
- 176 Java 8 Questions
- 86K Java Programming
- 82 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 208 Java User Groups
- 25 JavaScript - Nashorn
- Programs
- 666 LiveLabs
- 41 Workshops
- 10.3K Software
- 6.7K Berkeley DB Family
- 3.6K JHeadstart
- 6K Other Languages
- 2.3K Chinese
- 207 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 474 Portuguese
Not able to run SQLcl in windows CMD even after setting path in environment variables.

Hi All,
I have downloaded SQLcl latest version and added C:\sqlcl\bin in the environment variable path but when I open CMD prompt and type SQL to run SQLcl it didn't run and throws an error 'SQL' is not recognized as an internal or external command.
Could you advise what I am missing and why SQLcl is not running from CMD? I am able to run it directly from bin folder even though.
Best Answer
-
What Glen is alluding to is that sql.bat in 19c bin is being picked up, not sql.exe in your seperate sqlcl bin directory which is listed twice in your path AFTER the 19c bin directory, so put c:\installs\sqlcl\bin FIRST, not in the middle and last. That way when you type sql at the command prompt it can look in the c:\installs\sqlcl\bin directory first. So try that.
For example, at the cmd prompt you can:
C:\> path=C:\installs\sqlcl\bin;%PATH%
to set sqlcl dir first, or edit the PATH in system settings etc and put it first instead of middle and last which is what echoing your current pah shows.
Answers
-
Sounds like you haven't set the PATH variable correctly.
Start a CMD prompt and copy/paste this:
C:\> echo %PATH:;=&echo.%
Is the path to sql.exe included in the list?
For debugging set the PATH variable locally by
C:\> set path=%PATH%;C:\sqlcl\bin
(If indeed that is where you installed sqlcl)
Something else to check, make sure sqlcl was installed properly by navigating to where sql.exe is and executing:
C:\sqlcl\bin\> sql -v
Don't forget you also need a compatible version of java jdk installed.
-
Thanks for the response but the path is correctly set and sqlcl is running from its folder directly.
-
can someone help here please?
-
The syntax of the command is incorrect .
is very different from
'sql' is not recognized as an internal or external command, operable program or batch file.
Maybe try "where sql" to see what else may be getting in the way?
-
Nothing comes up -
-
So clearly it is trying to run sql.bat in the Oracle 19c home. I still have Oracle 11g XE installed locally, there is no sql.bat in that home, so I have no visibility into what might be in your sql.bat.
Edit: So try prefixing PATH with the C:\Installs\sqlcl\bin instead of suffixing it.
-
Hi Glen,
Thanks for all the valuable inputs. But I couldn't understand the below point -
Edit: So try prefixing PATH with the C:\Installs\sqlcl\bin instead of suffixing it.
-
What Glen is alluding to is that sql.bat in 19c bin is being picked up, not sql.exe in your seperate sqlcl bin directory which is listed twice in your path AFTER the 19c bin directory, so put c:\installs\sqlcl\bin FIRST, not in the middle and last. That way when you type sql at the command prompt it can look in the c:\installs\sqlcl\bin directory first. So try that.
For example, at the cmd prompt you can:
C:\> path=C:\installs\sqlcl\bin;%PATH%
to set sqlcl dir first, or edit the PATH in system settings etc and put it first instead of middle and last which is what echoing your current pah shows.