Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQLPLUS Question
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!
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