How to run an SQL script inside a shell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to run an SQL script inside a shell
# 1  
Old 06-15-2006
Question How to run an SQL script inside a shell

How do I create a K Shell which would silently (without user input) logon to Oracle and
run an SQL script?

Any help will be greatly appreciated.

Steve
# 2  
Old 06-15-2006
I found it out myself.

sqlplus -s username/password @script.sql
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Capture run time of python script executed inside shell script

I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution... (2 Replies)
Discussion started by: Adfire
2 Replies

2. Shell Programming and Scripting

How to run scripts parallely inside shell script?

Hi , I have 4 scripts example script1,script2,script3,script4 . I have to run script1,script2 and script3 parallely since this 3 scripts dont have dependencies . Once script1,script2 and script3 got completed successfully , I have to trigger script4. Can someone help me on this how to... (10 Replies)
Discussion started by: vinothsekark
10 Replies

3. Shell Programming and Scripting

Sql command inside shell script runs without giving anything back as outout

#!/bin/sh # This script returns the number of rows updated from a function echo "The execution is starting ....." sqlplus -silent $UP <<EOF set serveroutput on set echo off set pagesize 0 VAR no_rows_updated NUMBER; EXEC :no_rows_updated :=0; DECLARE CURSOR c_update is SELECT * FROM... (4 Replies)
Discussion started by: LoneRanger
4 Replies

4. Shell Programming and Scripting

run sql queries from UNIX shell script.

How can i run sql queries from UNIX shell script and retrieve data into text docs of UNIX? :confused: (1 Reply)
Discussion started by: 24ajay
1 Replies

5. Shell Programming and Scripting

Run .exe inside shell script

I have to run some shell scripts in Windows using Cygwin. I am able to achieve that using %BASH% --login -i "/cygdrive/d/script.sh" , where %BASH% is an environment variable in Windows set to C:\cygwin\bin\bash.exe. I have a created a Cygwin environment variable $EXE_PATH =... (3 Replies)
Discussion started by: HemanthJayasimh
3 Replies

6. Shell Programming and Scripting

Run SQL thru shell script: how to get a new line when run sql query?

Hi, this's Pom. I'm quite a new one for shell script but I have to do sql on shell script to query some information from database. I found a concern to get a new line...When I run my script, it retrieves all data as wondering but it's shown in one line :( What should I do? I'm not sure that... (2 Replies)
Discussion started by: Kapom
2 Replies

7. Shell Programming and Scripting

Run Sql plus in shell script

Hello, I want to connect to ssh, run a query, and store that into a variable in the shell script. Also I need to pass the variable back to php to display the query results. I have created a public/private key pair for ssh connection and that is working fine. Also I am able to run query in the... (8 Replies)
Discussion started by: shekhar2010us
8 Replies

8. Shell Programming and Scripting

how to run shell script inside expect script?

I have the code like this : shell script continues ... .... expect -c" spawn telnet $ip expect "login:" send \"$usrname\r\" expect "Password:" send \"$passwd\r\" expect "*\>" send \"$cmdstr\r\" ... (1 Reply)
Discussion started by: robbiezr
1 Replies

9. Shell Programming and Scripting

shell script to run .sql files

hi Friends, Please help me in writing shell script to run list of sql files. database is Oracle 9i, unix os is solaris Requirement is 1. sql file must take two inputs a)feed id and b)business date 2.shell script must out put .xls or .csvfile as out put without trimming any column name and... (1 Reply)
Discussion started by: balireddy_77
1 Replies

10. Shell Programming and Scripting

How to run unix commands in a new shell inside a shell script?

Hi , I am having one situation in which I need to run some simple unix commands after doing "chroot" command in a shell script. Which in turn creates a new shell. So scenario is that - I need to have one shell script which is ran as a part of crontab - in this shell script I need to do a... (2 Replies)
Discussion started by: hkapil
2 Replies
Login or Register to Ask a Question