LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-25-2008, 01:34 AM   #1
anandv_1234
LQ Newbie
 
Registered: Dec 2007
Posts: 8

Rep: Reputation: 0
Question I wanted to run my sql program in my shell script?


Dear Folks,

I have a shell script which will manipulate my lst file, which is coming from my pl/sql program, so i want to run my pl/sql program in my shell script.

Thanks in advance.....

Thanks and Regards,
V.Anand,
Bangalore.
India.
 
Old 02-25-2008, 06:35 PM   #2
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
Invoke Utility

This looks like an Oracle SQL script, but that does not matter. I run SQL scripts for Informix from a lot of shell scripts. I have two utilities installed for Informix, dbaccess and isql. Both are capable of running sql scripts from the command line.

You need to find a similar utility for your database, unless these scripts can be marked executable directly and invoked right out of the shell script, but my educated guess is you need to invoke the utility.

isql invocation is like this:

isql ics my_script.sql

where

isql is the program (utility) name,
ics is the database (ics.dbs), and
my_script.sql is a file filled with sql statements, and you can leave off the .sql.

I cannot use these scripts if they depend on embedded sql
(select w.* into ws_bill_rec.* from ws_bill w where w.yr = "08"). I have to use a language like 4GL for that.
 
Old 02-25-2008, 07:12 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,258

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
There is plenty of help here: http://www.orafaq.com/wiki/SQL*Plus_FAQ
You can call sqlplus from the cmd line passing the name of the file, or run a file from within the sqlplus program.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
a script run through a shell program... okeyla Linux - Newbie 1 09-15-2005 11:06 AM
Creating a shell script to run Java program paultaylor Programming 7 11-12-2004 04:11 PM
Shell script to run pl/sql script. colly Linux - General 1 09-09-2004 07:49 AM
how to run a shell script type program redragon7964 Linux - Newbie 1 04-06-2004 03:03 AM
run shell script in c program u4u Linux - General 1 02-14-2004 03:48 PM


All times are GMT -5. The time now is 01:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration