EOF problem

hi
i am trying to connect to database by two method one is

sqlplus fss_blf/fss_blf@schema1
>select * from schema1_ta_example
exit

above method succesfffuly connect it to dabase
but the problem comes when i try to enter this code into mine shell script by using EOF character it is giving following problem

sqlplus fss_blf/fss_blf@schema1 << EOF
>select * from schema1_ta_example
EOF

now it is giving the error schema_ta_example does not exist , why because from the above first method it connect successfully and display the content of table why it is giving the error if i put EOF

pls help me regarding this

---------- Post updated at 07:29 AM ---------- Previous update was at 07:03 AM ----------

hi
can anyone pls help me regarding this i have googled it too but did not find any good solution

y it is giving the error if i put the EOF

There's nothing wrong with the here-document ("EOF"), but your script is incorrect. Remove the ">" character right before your query and put the sql terminator ";" after it.

tyler_durden

hi actually the > character comes when i write this command on command line but if i write on shell script then it won't come and also i put the semicolon too but still it did not work.

actually in my company there are two database so if i connect to other database and ifi write same query then it works like butter but for this database it is giving problem

(1) Print the content of your shell script on the Unix/Linux prompt. Use this command below, replacing name_of_your_shell_script by the actual name of your shell script.

cat -n name_of_your_shell_script

(2) Execute your shell script on the Unix/Linux prompt.

(3) Select and copy your commands and output of steps (1) and (2) and paste them here.

tyler_durden

In the first example you were answering a SQL prompt where the asterisk has only one meaning.
In the second example the commands were first seen by unix shell. It is then necessary to protect the asterisk from the shell and also to exit from SQL.

select \* from schema1_ta_example;
quit