5

everyone! I want to know what this line does:

sqlplus -s /nolog <<EOF

Any ideas? Thanks for the help!

2
  • 1
    I take it that EOF is a heredoc and not a file? Commented Feb 10, 2012 at 17:25
  • Yeah. This line is executed in Unix shell. Commented Feb 10, 2012 at 17:28

3 Answers 3

8

From the information that you provided in the comments:

sqlplus -s /nolog <<EOF

Fires up an instance of sqlplus with silent mode enabled (which, I believe, doesn't send out any output to the console screen), and without a login explicitly provided (hence the /nolog), and it's taking input from the string contained in the EOF heredoc (which probably contains login credentials).

Here is a quick overview of Oracle's documentation on sqlplus.

Sign up to request clarification or add additional context in comments.

Comments

6

From HERE:

-s The silent option: it suppreses the output of the SQL*Plus banner, the command prompt and the echoing of commands.

/nolog Starts SQL*Plus but does not log on (connect) a user/session.


So it seems that starts SQL*PLUS without logging on a user/session (nolog option) and don't display info (silent option).

Comments

3

The full excerpt should probably be:

sqlplus -s /nolog << ABCDE

CONNECT user/pwd@database
-- DO SQL AND PLSQL STUFF
EXIT

ABCDE

Which is similar to running sqlplus -s user/pwd@database @script.sql where script.sql contains the sql, plsql stuff and the exit command. The << syntax is shell operator for heredoc, which means all following lines are variable-expanded if ${variables} are found, and the first line beginning with ABCDE (at the very beginning of the line, no spaces, no tabs) ends the input.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.