Friday, September 02, 2005

here command in unix shell script function

here command in unix shell script function

Hello All,

I use here command to whenever I need to connect to Oracle through
korn shell script say e.g.

sqlplus user/passwd@database << EOF
SELECT * from tab;
EOF

But I am not able to this from function written in korn shell script.

e.g.

raise_error() {

## some code
sqlplus user/passwd@database << EOF
SELECT * from tab;
EOF

## some code
}

While I try to run this shell script, it gives me syntax error:
Message: syntax error at line 66, << unmatached.

Please can anybody help me how I can connect to Oracle from unix shell
script function.

Thanks,

Nice

osted By Reggie Beavers On Monday, August 22, 2005 at 10:53 AM

Hi Nice,

Try it this way:

echo 'select * from tab;' | sqlplus user/pass@db /nolog

Regards,
--
Reggie Beavers

0 Comments:

Post a Comment

<< Home