SQL not executing from cmd command

58 Views Asked by At

If I run this command in a command prompt window:

start C:\sqlcl-latest\sqlcl\bin\sql /nolog

sqlcl opens and, if I type:

show tns

My mapped TNSNames are listed.

However, if I go with a single line in cmd:

start C:\sqlcl-latest\sqlcl\bin\sql /nolog show tns

SQLCL opens but it closes immediately showing an error I cannot see (it closes very quickly, almost instantly). What would be the way to fix this and make it behave like the above 2 commands?

1

There are 1 best solutions below

4
On

Try the following:

start C:\sqlcl-latest\sqlcl\bin\sql /nolog & show tns

The important separator here is the &, which indicates a second command within the same line.