Retrieve data and redirect to a file


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Retrieve data and redirect to a file
# 1  
Old 01-15-2010
Retrieve data and redirect to a file

How to write a shell script to retrieve datas from database after that this database are redirect to a excell sheet and then i got a mail that gives details about the database with the column name and data..

I m using oracle 9i...

Thanks,
Anup Das
# 2  
Old 01-15-2010
Get your data by calling appropriate SQL queries like SELECT etc. maybe via SQLPLUS and redirect it to someoutput file. As output delimeter you might want to choose something appropriate, maybe a semicolon, depending to your data so that it can be imported as let's say .csv file.
How to check for return codes of commands and how to send a notify mail is covered in plenty posts in this forum.
# 3  
Old 01-18-2010
Connect to Oracle

Run the select and store the output in a variable or file.

Email the file - uuencode file file.csv | mail mail.com
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How can I retrieve the matching records from data file mentioned?

XYZNA0000778800Z 16123000012300321000000008000000000000000 16124000012300322000000007000000000000000 17234000012300323000000005000000000000000 17345000012300324000000004000000000000000 17456000012300325000000003000000000000000 9 XYZNA0000778900Z 16123000012300321000000008000000000000000... (8 Replies)
Discussion started by: later_troy
8 Replies

2. Shell Programming and Scripting

Retrieve data from one file comparing the ID in the second file

Hi all, I have one file with IDs Q8NDM7 P0C1S8 Q8TF30 Q9BRP8 O00258 Q6AWC2 Q9ULE0 Q702N8 A4UGR9 Q13426 Q6P2D8 Q9ULM3 A8MXQ7 I want to compare ID file with another file which has complete information about these IDs and also about other IDs which are not in the above ID file. As... (10 Replies)
Discussion started by: kaav06
10 Replies

3. Shell Programming and Scripting

Redirect output to a different text file depending source of data

I have a list of DNS servers I need to look up information on. Each of these servers has a master and a slave database. Essentially what I need to do is create two text files for each server. One with the Master view and one with the Slave view. There's 20 servers, in the end I should have 40 text... (4 Replies)
Discussion started by: spartan22
4 Replies

4. Shell Programming and Scripting

How to retrieve a number or string from file1 and redirect into file2 in perl script?

hello forum members, I am siva ,As i am new to perl scripting i looking help from forum members. i need a sample program are command for pattern matching. I have file name infile1 which some data, I need to search the particular number are string in the file which repeats n number of... (0 Replies)
Discussion started by: workforsiva
0 Replies

5. UNIX for Dummies Questions & Answers

How to compare two columns and retrieve data

I am a newbie to Unix and slowly learning it. I have a large data set with 8 different columns. I want to compare two columns and retrieve data if the two columns have similar number. I have attached the example. There are two columns (S-Contig and N-Contig). I want to retrieve the data from... (7 Replies)
Discussion started by: bjorngill
7 Replies

6. Shell Programming and Scripting

More time to retrieve data from DB

Hi All, It takes around one hour to retrieve 3 lakhs data from DB. I feel this can be still more reduced, please help me in improvising the below code, to get it retrieve faster, atleast 30 to 45 minutes. sqlplus -s ${OCAU_DB_UNAME}/${OCAU_DB_UPSWD}@${OCAU_DB_NAME} > /apps/data/filedata.txt... (4 Replies)
Discussion started by: pattamuthu
4 Replies

7. Shell Programming and Scripting

need a script to redirect the command prompt data int a log file.

Hello forum memebers, I have to write a script to copy command arguments into a log.please see the below issue and help me to complete it. i have command "mkidcfg" it is custiomized.I will run the command with one arguments . mkidcfg -I _config.db_ids it will open the below options. 1... (2 Replies)
Discussion started by: rajkumar_g
2 Replies

8. Programming

to find header in Mp3 file and retrieve data

hi all, In an mp3 file , data is arranged in sequence of header and data ,how to retrieve data between two headers. Is the data between two headers fixed? because as per theory it says 1152 samples will be there , but dont knw how many bits one sample correspond to? it would help if any c... (2 Replies)
Discussion started by: shashi
2 Replies

9. Shell Programming and Scripting

Retrieve data from a file

Hello guys I want to retrieve two data from a file, like this: bash-2.03$ cat numtest 123456 123457 bash-2.03$ more ./test_num #!/bin/bash num1= num2= cnt=1 while read x do num${cnt}=$x cnt=$(($cnt+1)) done <$1 echo $num1 "\n" $num2 But when i executed this script, error... (2 Replies)
Discussion started by: tpltp
2 Replies
Login or Register to Ask a Question