Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: ksh >> ORACLE

Re: ksh >> ORACLE

From: Davide Bianchi <davidebianchi_at_davidebianchi.net>
Date: Wed, 19 Sep 2001 11:43:43 +0200
Message-ID: <9o9pd9$c0l7r$1@ID-18487.news.dfncis.de>


"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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US