LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
LinkBack Search this Thread
Old 10-24-2007, 07:21 AM   #1
ring
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
Ring
 
Old 10-25-2007, 09:25 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Which database are you using, how do you interface with it from the
command-line?


Cheers,
Tink
 
Old 10-25-2007, 10:48 PM   #3
ring
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;
exit;
END`
 
  


Reply

Tags
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
insert lines in a function using shell script shyamdey Programming 1 08-30-2006 07:48 AM
help with shell script - fill an array with values from a file delmoras Linux - General 1 07-17-2006 11:19 AM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
creating shell script that executes as root regardless of who runs the script? m3kgt Linux - General 13 06-04-2004 10:23 PM
How to change parameter values of a function in shell script? Bassam Programming 0 01-25-2004 09:52 AM


All times are GMT -5. The time now is 08:59 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration