0

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?

PM 77-1
  • 12,933
  • 21
  • 68
  • 111
Javi Torre
  • 724
  • 8
  • 23

1 Answers1

0

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.

Sirmyself
  • 1,464
  • 1
  • 14
  • 29
  • It does not recognize show as a command because I am trying to execute show tns in the program that was just opened, not in cmd as well. – Javi Torre Jan 25 '23 at 15:24
  • Oh I see. then you might need to create a batch file that runs both commands, the first from the command prompt, then the second from the started service – Sirmyself Jan 25 '23 at 15:28
  • No way to do it in one line? – Javi Torre Jan 25 '23 at 15:29
  • 1
    well if you create a batch file, then use the command prompt to run the file, that would be one line. Otherwise, there may be an option on the `start sql` command that would show the tns, but I have to look that up – Sirmyself Jan 25 '23 at 15:30