Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlplus does not exit after running build #5

Closed
mortenbra opened this issue Mar 16, 2017 · 3 comments
Closed

sqlplus does not exit after running build #5

mortenbra opened this issue Mar 16, 2017 · 3 comments

Comments

@mortenbra
Copy link

The readme suggests making a task to run sqlplus to build/compile code.

Unless the script/file contains an "exit" statement, sqlplus will hang in the background and never complete, as described here: http://serverfault.com/questions/87035/run-oracle-sql-script-and-exit-from-sqlplus-exe-via-command-prompt

A solution that works better is to create a bat file, such as run_sqlplus.bat and place the following command inside it:

echo exit | echo show errors | sqlplus %1 %2

The build task definition then becomes:

 {
        "version": "0.1.0",

        // The command is a shell script
        "isShellCommand": true,

        // Run sqlplus via a batch file
        "command": "run_sqlplus.bat",

        "args": ["username/password@sid", "@\"${file}\""]
    }

This will run sqlplus, output any errors, and then exit cleanly back to VS Code.

It would be great if you could update the readme with this workaround/improvement.

@zabel-xyz
Copy link
Owner

Thank you for sharing this information. I'll include it in the readme...

@zabel-xyz
Copy link
Owner

fix in version 0.0.9

@apercova
Copy link

apercova commented May 5, 2017

Another approach can be to add an "echo" command with the "sqlplus" command as a command argument as shown:

"tasks":[
        //Run sqlplus in args
        {
        "taskName":"sqlplus",
        "command":"echo", 
        "args":["exit","|","echo","show","errors","|","sqlplus","username/password@sid","@\"${file}\""],
        "isShellCommand": true,
        "showOutput": "always"
        }
    ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants