Can any one explain this sqlplus command?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Can any one explain this sqlplus command?
# 1  
Old 05-22-2013
Can any one explain this sqlplus command?

Hi ,

i am new to unix i need a small clarification regarding this

Code:
sqlplus -s $USER_NAME/$PASSWD@$ORA_SID<< EOF >> SQL_CONN_LOG.log

In the above command what is the meaning of <<EOF>>
Thanks,
krishna.

Last edited by Scott; 05-22-2013 at 04:16 AM.. Reason: Code tags
# 2  
Old 05-22-2013
<<EOF=End Of File
Read all lines to the code until it find a new EOF
http://en.wikipedia.org/wiki/Here_document

>> SQL_CONN_LOG.log append data to log file.
# 3  
Old 05-22-2013
The opening << EOF delineates the start of a "here-document". It's not related to >>, which is a redirection to append to a file, whose name should follow >>.

A here document would be terminated with a matching EOF. EOF is arbitrary, and can be almost anything.
Code:
sqlplus .... << EOF
...
EOF
# or...
sqlplus .... << HereDoc
...
HereDoc

It's common to use an exclamation mark
Code:
sqlplus -s .... << !
...
!

because Unix programmers are lazy and EOF is two times two characters too many to type!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Explain iconv command

I have a requirement to remove all non-ascii characters from a fixed length file. I used the below command which is removing special characters but somehow the total record length is being truncated to one space less. If it is a multi-byte string then many characters at the end are being truncated.... (8 Replies)
Discussion started by: eskay
8 Replies

2. UNIX and Linux Applications

Problem on SQLplus command ""bash: sqlplus: command not found""

Hi all, i face an error related to my server ""it's running server"" when i use sqlplus command $ sqlplus bash: sqlplus: command not found the data base is up and running i just need to access the sqlplus to import the dump file as a daily backup. i already check the directory... (4 Replies)
Discussion started by: clerck
4 Replies

3. Shell Programming and Scripting

Can someone explain the following shell command?

Hi Forum. I have the following script /home/user/EDW_ENV.sh to setup some environment variables as: ##### section 1 PM_HOME ##### export PC_DIR_BASE=/data/informatica/ming export DIR_ORACLE=/data/sw/apps/oracle/Oracle_scripts export... (4 Replies)
Discussion started by: pchang
4 Replies

4. Red Hat

Please help to explain the command

su - keibatch -c ""date ; /usr/local/kei/batch/apb/bin/JKEIKYK4140.sh -run "&$C$6&" WSUKE100201"" Not clear about : date ; /usr/local/kei/batch/apb/bin/JKEIKYK4140.sh -run "&$C$6&" WSUKE100201 Please help (2 Replies)
Discussion started by: honda_city
2 Replies

5. UNIX for Dummies Questions & Answers

Please explain this grep command

Please explain grep -A 999999. I've seen this before, it always seems to be with six 9's as well. See an example below. grep 'regexp' -A 999999 server.log | egrep -c 'Option=\' (6 Replies)
Discussion started by: scj2012
6 Replies

6. UNIX for Dummies Questions & Answers

Please explain this command?

Hi, I saw this. But I don't know why we need this? ls mydir > foo.txt ## I know what this will do, it will take the results and write to the file called foo.txt ls mydir > foo.txt 2>&1 ## Don't know why we need 2>&1 Thanks. (2 Replies)
Discussion started by: samnyc
2 Replies

7. Shell Programming and Scripting

Please Explain me this command

find . -type f -ctime +3 -exec mv {} /somedirectory/ \; in particular "-ctime v/s -mtime" and "difference between +3 and -3" (5 Replies)
Discussion started by: Rambo
5 Replies

8. UNIX for Dummies Questions & Answers

Can anyone explain what this command is doing?

Specifically what is the purpose of sed? What is f? Why is the 'cp f $phonefile' line needed when the script ‘goes live'? Why might that two commands following sed be commented out at the present time ( i.e., during development)? Thanks in... (2 Replies)
Discussion started by: knp808
2 Replies

9. Shell Programming and Scripting

please explain the command

Hi all , please explain the following command : perl -e 'select(undef,undef,undef,.15)' Thanks and Regards Navatha (2 Replies)
Discussion started by: Navatha
2 Replies

10. UNIX for Dummies Questions & Answers

Explain the output of the command....

Explain the output of the command “sort -rfn file1 | more” (1 Reply)
Discussion started by: wickbc
1 Replies
Login or Register to Ask a Question