SQL not executing from cmd command - oracle

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?

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.

Related

AppleOS Terminal to MS Command Prompt translation

How do I translate the Terminal command
pdf2txt.py -o filename.txt -t tag filename.pdf
for the Command Prompt on a Windows machine?
The commands are arguments passed to the pdf2txt.py script and they depend on the code inside the file, not on any terminal/command prompt constraints. So, the code remains exactly the same

How do I open a shell but still have access to vim

I am running gvim on Windows 7.
I use this mapping to execute the current file with powershell:
nnoremap <C-q> :! & '%:p'<cr>
It works great except I can't access vim until I close the powershell window. Sometimes I want the shell to remain open so I can run additional commands or I want to access vim with the shell still open so I can check the lines where errors were generated.
Ideally (don't know if this is possible) I want to have an already open shell execute the command. So I always have vim and a shell open (on separate monitors) and I can execute the script in that same shell.
How can I achieve this?
GVIM on Windows has a special :!start command to execute the external command asynchronously; i.e. Vim doesn't wait for its return. Just replace the :! with it. See :help :!start for more information.
On Unix, such special isn't necessary; you can just append & (a shell feature) to execute the command asynchronously.

Command line commands not executing?

Hello all well I have no idea why no commands will execute in my CMD.
i tried executing ping http://google.com and it tells me it's not recognized?
thanks.
Your path statement has changed.
Type path and see what it shows in a fresh command window

Is there a way to stop SQL*Plus exiting on Control-C?

I'm using SQL*Plus on Windows, and keep accidentally hitting Ctrl-C, which causes SQL*Plus to exit. Is there any way to prevent this?
The best workaround I've found so far is to prepend the command with cmd.exe /k as suggested here, which at least keeps the prompt open so you can still see the previous commands and results.
start /b sqlplus.exe scott/tiger #script.sql

Suppress command window when running console application on Windows

Is there a way to suppress showing the command window when running a console application on Windows XP?
Details: I am calling a (console-based) program from Vim. I would like to avoid the command window being shown every time I do this.
Try start /B <program name> to start the program without a new window.
Did you try shell.vim?
The xolox#shell#execute() function
This function enables other Vim
plug-ins to execute external commands
in the background (i.e.
asynchronously) without opening a
command prompt window on Windows.
i can't believe no one has suggested simply using :silent
for example, I have the following in my .vimrc (gvim on Win7)
"open windows explorer to the directory of the current file
:map <leader>ex :silent !Explorer %:p:h<CR>
When I didn’t want to see the output of external commands called from the Vim command line, I would prepend them with :silent. However, this results in a command window momentarily flashing on screen when running GVim under MS Windows. After a short while, I got annoyed by this behaviour so I researched alternative solutions (which is how I came across this question).
The best solution I came up with was to use Vim’s inbuilt system function which runs shell commands without opening an external command window. While the output of the shell command is not printed, its exit status is conveniently available via v:shell_error. It also has the advantage that it’s portable across (all) platforms.
Example (the echo statement should print 0 if C:\Windows exists):
call system("dir c:\windows")
echo v:shell_error
You could maybe use some autohotkey script of this kind:
Loop {
WinWait, my command window title
WinHide
}
I was trying to use git-bash as my shell from vim on Windows but having the command prompt open whenever a command was run, as you described. My eventual solution was to install the plugin xolox/vim-shell and add the following snippet to .vimrc:
if has('win32')
set shell=bash\ -c
set shellcmdflag=
set shellxquote='
set shellquote=
set shellredir=>
set noshelltemp "This prevents an external window from opening.
endif
This utility will also do the job:
http://www.ntwind.com/software/utilities/hstart.html

Resources