Home » SQL & PL/SQL » SQL & PL/SQL » Insert into oracle table of unix script values. (Unix )
Insert into oracle table of unix script values. [message #573219] Mon, 24 December 2012 05:32 Go to next message
Messages: 13
Registered: September 2008
Junior Member

Hi All,

I want to insert STAT and ENDTIME values for each job in joblist into TBL_DAILY_STATUS table.

Eg: insert into tbl_daily_status values(STAT,ENDTIME);

Please help me on this.

joblist="com_abc_job com_abc_dot_job com_abc_seq com_abc_det"
for i in $joblist
STAT=`./JobStatus.pl -i NP1 -z Z8PIMBN -p $i|awk '{print $6}'`
ENDTIME=`./JobStatus.pl -i NP1 -z Z8PIMBN -p $i|awk '{print $4" " $5}'`
echo "$STAT"
echo "$ENDTIME"
Re: Insert into oracle table of unix script values. [message #573221 is a reply to message #573219] Mon, 24 December 2012 06:26 Go to previous messageGo to next message
Michel Cadot
Messages: 65085
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From one of your previous topics:

Michel Cadot wrote on Sat, 18 August 2012 11:33
With any SQL question, Post a working Test case: create table and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Before, Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.

In addition, FEEDBACK to those that help you, we are still waiting for you in your previous topics.
Me, I can no more help you if I never have feedback telling if the time I spent for you was useful or just a waste of time.

In the end, how is this a SQL question?


[Updated on: Mon, 24 December 2012 06:27]

Report message to a moderator

Re: Insert into oracle table of unix script values. [message #573222 is a reply to message #573219] Mon, 24 December 2012 06:27 Go to previous message
Messages: 536
Registered: March 2009
Location: Iran / France
Senior Member
One possible solution is to redirect the output of the loop in your KornShell script into a .txt file and then you can create a script/batch that runs SQL*Loader_FAQ upon that data file in order to insert values into the table.


Edit: Oh, sorry I didn't see Michel's comment before posting this, otherwise I wouldn't have posted Laughing

[Updated on: Mon, 24 December 2012 06:30]

Report message to a moderator

Previous Topic: Transferring data from one DB to another DB
Next Topic: query no check wrong mapping
Goto Forum:

Current Time: Mon Jul 24 08:02:37 CDT 2017

Total time taken to generate the page: 1.28392 seconds