-
SQL commands from SHELL prompt
Hi Friends,
Is it possible to execute SQL or PL/SQL commands from Unix shell prompt. For example, I want to execute a CREATE COMMAND from "$" prompt.
eg.
$ sqlplus SCOTT/TIGER CREATE TABLE t1(I INT)
Thanks
gandhi
-
Code:
sqlplus -s /nolog "<<"ENDSQL
connect connectstring
@script1.sql or put your SQL script here.
EXIT;
ENDSQL
Why don't you search in the net?
Note: Please remove the "" from "<<"ENDSQL.
Last edited by Thomasps; 12-29-2003 at 12:30 AM.
-
Re: SQL commands from SHELL prompt
Originally posted by gandhi
Hi Friends,
Is it possible to execute SQL or PL/SQL commands from Unix shell prompt. For example, I want to execute a CREATE COMMAND from "$" prompt.
eg.
$ sqlplus SCOTT/TIGER CREATE TABLE t1(I INT)
Thanks
gandhi
I am trying to execute OS commands through PL/SQL, you are trying to execute Oracle command on OS level :-) What a world...
Oracle Certified Master
Oracle Certified Professional 6i,8i,9i,10g,11g,12c
email: ocp_9i@yahoo.com
-
U can run sql
Hi,
The previous explanation is correct.
$sqlplus /nolog <
now u can write all the sql command after giving the connect string.
to end your session.
you need to give !END
once again.
This is more helpful in making shell scripts which interact with oracle.
eg.
sqlplus /nolog <
alter system switch logfile
<
I hope this helps
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|