0

Not sure if this is Windows or Oracle related problem. I never used sqlcl and wanted to give it a go after installing Oracle 19c software and ORCL database on Windows 19.

My PATH: PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\app\oracle\product\19.3.0\dbhome_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;

So I can easily call sql.bat which sits in my path, C:\app\oracle\product\19.3.0\dbhome_1\bin; folder.

The script sql.bat looks pretty simple (just these two lines):

pushd ../sqldeveloper/sqldeveloper/bin && sql %*

popd

So If I call it like this:

C:\Users\Administrator>sql -help

The syntax of the command is incorrect.

No matter what I do, still the same error, ex. sql.bat /nolog

When I do it from this folder: C:\app\oracle\product\19.3.0\dbhome_1\sqldeveloper\sqldeveloper\bin, there is a proper response. I can also login to the database. I have also noticed, I am successful in this location only because when typing sql, sql.exe is being called directly here, not sql.bat.

Folder C:\app\oracle\product\19.3.0\dbhome_1\sqldeveloper\sqldeveloper\bin contains only sql.exe (plus a readme and linux shell file).

What am I doing wrong that I cannot run sql.bat (which in turn calls sql.exe)?

  • I would just go here (https://www.oracle.com/tools/downloads/sqlcl-downloads.html), download latest SQLcl, extract to new folder and run the EXE ... sql user/passwords@... – thatjeffsmith Nov 26 '19 at 16:55
  • what if you type in sql.bat (include the extension) – OldProgrammer Nov 26 '19 at 18:52
  • Calling sql.bat gives me this 'The syntax of the command is incorrect' if I call it from C:\app\oracle\product\19.3.0\dbhome_1\sqldeveloper\sqldeveloper\bin or any other folder. I also made a change to sql.bat and I replaced sql to sql.exe, so it looks like pushd ../sqldeveloper/sqldeveloper/bin && sql.exe %*. Calling it by sql.bat from any folder gives me this problem. – user1863063 Nov 28 '19 at 11:28
  • OK, I think I found it. It is the forward slash in the bat script, rather than the windows back slash. When I do adjust it though: The system cannot find the path specified. I can only run it from C:\app\oracle\product\19.3.0\dbhome_1\bin where the bat script exists. Any clue? This seems like windows scripting issue and relative path problem. – user1863063 Nov 28 '19 at 17:29
  • The resolution is to add this as the first line: pushd "%~dp0" and change / to \ in the second line, and add another popd as the last line. What I don't understand is why this is not working out of the box? I can only suspect, sql.bat should not be called directly as I do it. – user1863063 Nov 28 '19 at 17:36

0 Answers0