Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: ksh >> ORACLE
"ak" <a.kadivar_at_caramail.com> wrote in message
news:9o9ncu$2ofb$1_at_norfair.nerim.net...
> How can I connect me to un ORACLE DATABASE and execut
> un instruction like SELECT * FROM mytable in a kornshell
> script ? Thank you in advance.
You have to prepare a SQL script like
SPOOL somefilename
SELECT * FROM MYTABLE...
SPOOL OFF
EXIT
Then you run
sqlplus someuser/password_at_yourinstance @nameofyourscript
This will run your script and put all the results into the 'somefilename' specified in the script. Of course, the 'someuser' and 'password' must be a valid username and password and 'yourinstance' should be the name of the instance.
Davide Received on Wed Sep 19 2001 - 04:43:43 CDT