Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-24-2007, 08:21 AM   #1
LQ Newbie
Registered: Oct 2007
Posts: 2

Rep: Reputation: 0
Shell Script: want to insert values in database when update script runs

Hi ,

I am new to linux and also also to shell scripting.
I have one shell script which unpacks .tgz file and install software on machine.
When this script runs I want to insert id,filename,description(which will be in readme file),log(which will be in log file) and name of unpacked folder like: tmp/MyFile into "MyTable"(database).
I don't have any idea about how to read data from file and insert that data into database table. This is for description and log field. Datatype of these fields is CLOB. Even I want to find max(id) from exiting table data, so that I can insert mew entry as maxid+1.

I am facing problems while writing this script.
Could anybody help me with this?

Thanks in advance
Old 10-25-2007, 10:25 PM   #2
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927
Which database are you using, how do you interface with it from the

Old 10-25-2007, 11:48 PM   #3
LQ Newbie
Registered: Oct 2007
Posts: 2

Original Poster
Rep: Reputation: 0
I am using oracle database.
used commands are like this :
VALUE=`sqlplus -silent ypsystem/yp <<END
set pagesize 0 feedback off verify off heading off echo off
select max(id) from releasenotes;


linux, script, shell

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
insert lines in a function using shell script shyamdey Programming 1 08-30-2006 08:48 AM
help with shell script - fill an array with values from a file delmoras Linux - General 1 07-17-2006 12:19 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 06:32 PM
creating shell script that executes as root regardless of who runs the script? m3kgt Linux - General 13 06-04-2004 11:23 PM
How to change parameter values of a function in shell script? Bassam Programming 0 01-25-2004 10:52 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:44 AM.

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