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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQLPLUS Question

Re: SQLPLUS Question

From: XU <xux_at_informa.bio.caltech.edu>
Date: 16 Jun 1999 22:50:55 GMT
Message-ID: <7k99of$s3@gap.cco.caltech.edu>


Yes! You can do the same with SQL*PLUS in Oracle. "Here-text" is a shell feature. With SQL*PLUS, you just need to include the username/password at the first line, for example:

#!/bin/bash
sqlplus << EOF

scott/tiger          # this is the username/password to login the db
select * from emp;   # this is the SQL statement
exit                 # tell sqlplus to bailout
EOF                  # end of here-text

Good luck!



Robert Xu, Oracle DBA
Caltech, Pasadena, CA

Jorge Torralba (jorge.torralba_at_intel.com) wrote:
: I am new to Oracle transitioning from an Informix background. So, with
: that said please excuse this question if it sounds to simple.

: Is there a way of executing sql statements from within a shell script
: without referencing an external sql file. For example, with Informix
: you can put the following in a shell script:

: .
: .
: dbaccess dbname << EOF
: select * from mytable;
: EOF
: .
: .

: I would like to do something similar in Oracle.

: Thanks,

: Jorge :-)
Received on Wed Jun 16 1999 - 17:50:55 CDT

Original text of this message

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