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
visuora@yahoo.com
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.

#!/bin/ksh
joblist="com_abc_job com_abc_dot_job com_abc_seq com_abc_det"
for i in $joblist
do
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"
done
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: 58633
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?

Regards
Michel


[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
dariyoosh
Messages: 531
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.

Regards,
Dariyoosh


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: Thu Jul 31 10:55:56 CDT 2014

Total time taken to generate the page: 0.08302 seconds