1846858 Members
8359 Online
110256 Solutions
New Discussion

Re: Script Query

 
Hunki
Super Advisor

Script Query

I have this wrapper inside a script but it fails at this point with the following error :

line 39 :
/oracle/product/8.1.8/bin/sqlplus -s / <
syntax error at line 39 : `<<' unmatched

5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: Script Query

Hi:

Make sure that your 'here' document body (the part begfore the 'EOF' is flush-left without leading spaces.

Regards!

...JRF...
Peter Godron
Honored Contributor

Re: Script Query

Hi,
have you code something like:
/oracle/product/8.1.8/bin/sqlplus -s / <select * from ....;
quit;
EOF

Watch out for leading spaces before the second EOF (there shouldn't be any).
spex
Honored Contributor

Re: Script Query

Hunki,

If you append - to <<, leading tabs are stripped from the here-document...

sqlplus -s / <<-EOF

PCS
Bill Hassell
Honored Contributor

Re: Script Query

Very important: EOF *must* be left-justified -- no leading spaces. The option <<- will allow leading tabs but NOT never leading spaces. It is common to indent 'here documents' for readability but the terminating string (EOF in your case) must start in column 1 to be recognized.


Bill Hassell, sysadmin
Hunki
Super Advisor

Re: Script Query

I found the solution to this one ... thanks all for replying ,

(sqlplus -s / <blah blah ...

) > /dev/null