Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to run a command on remote database (oracle) from local server using sqlplus, eg:

sqlplus user/pass@db "command"

What's the syntax for it?

I want to use the command exit (from database) just to test something in a unix script.

share|improve this question
add comment

1 Answer

try this in the below example i am calling test_procedure.

sqlplus "username/password@tns_name" <<\!

exec test_procedure();

!
share|improve this answer
    
Use this from comment --> sqlplus "username/password@tns_name" <<! exec test_procedure(); ! –  SrikanthM Mar 7 '11 at 14:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.