Retrieving data from a database and store to a file

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Retrieving data from a database and store to a file
# 1  
Old 06-07-2010
Retrieving data from a database and store to a file

Hi

I'm using and Oracle 10g Database.

I want to write a script to retrieve data from the database and store it toa file.

I'm using simple sql statements such as

Code:
Select * from celltable

I don't know how to specify the database name etc.

I have this but it doesn't work

Code:
#!/bin/bash
sqlstr = <<-'SQL'
select * from celltable > importcell.csv
SQL

# 2  
Old 06-07-2010
This site has a very cool search utility, labeled 'grep', in the upper-right corner. Plugging in Oracle and connection gives me: Google Search Results for oracle connection | The UNIX and Linux Forums
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Extract data from a file and store it in a variable

Hi , I have an file like below , cat input.txt 'Pattern2' => 'blahdalskdahdlahldahdlakhdlahdlkajdlkaadasdadadadadadadasda ajlalnalndklandlaksdlkaddd' 'Pattern2' => 'aohaonalkndlanldandlandklasnldnaldnak' ............ ........ ..... Here is what am trying to do , I want to grep for... (3 Replies)
Discussion started by: scott_cog
3 Replies

2. Shell Programming and Scripting

Retrieving sequence data from other file

Hello experts :cool:, I am new to programming and will need your help.. I have 2 very large files with the following format: FILE1: >MLP1019 PL4 >MLP7456 PL3 >MLP9268 PL9 >MLP6245 PL1 FILE2: >MLP1019 STNAPLQTSNTWVSYQPSMMMSLQ >MLP7456 PPYWYWNSAVMIFYVQPLSLLAVLLA >MLP9268... (2 Replies)
Discussion started by: narachaid
2 Replies

3. Programming

How to extract data from CVS log files and store it in database ?

Am currently working on CVS projects .. I have generated the cvs log file which is in the RCS file format . .I want to extract file path ,total revision ,date ,author and message from that file . .I want a program in java which would extract the data from cvs log file. .Pls help me out.. My... (0 Replies)
Discussion started by: EVERSOFT
0 Replies

4. Linux

Retrieving Data from VHD File (Virtual Machine Harddrive)

Hello, I had Gentoo installed on a Microsoft Windows Hyper-V virtual machine. The system shutdown properly but the RAID array on the drive it was on failed. We had a backup that was poorly configured and as such we didn't back up all of the data we needed. Therefore, after getting the RAID... (0 Replies)
Discussion started by: ckoeber
0 Replies

5. Shell Programming and Scripting

Execute stored procedure through script in sybase database and store the output in a .csv file

Hi, I have a sybase stored procedure which takes two input parameters (start_date and end_date) and when it get executed, it gives few records as an output. I want to write a unix script (ksh) which login to the sybase database, then execute this stored procedure (takes the input parameter as... (8 Replies)
Discussion started by: amit.mathur08
8 Replies

6. Shell Programming and Scripting

store the table data in excel file

Hello - I have a below table and i want to extract the data into excel sheet and send to different location. Here is the table structure... SQL> desc t_i1_exportdocs Name Null? Type ----------------------------------------- --------... (11 Replies)
Discussion started by: govindts
11 Replies

7. Shell Programming and Scripting

extracting data and store in database

Hello all, I have this text file data. The data are separated by comma in three column and space or line feed to start a new row anderson helberg, Jane, brother Sister ,mother,grandpa bombay,new york, china I would like store them in the following format. field1 ... (2 Replies)
Discussion started by: mam
2 Replies

8. Shell Programming and Scripting

How to store Data in a File

I want to read a data from a read command and store it in a file...... Plz send me how I can do that Ex: read val and I want to store this val in a file called temp. (2 Replies)
Discussion started by: krishna_sicsr
2 Replies

9. Shell Programming and Scripting

Using loop reading a file,retrieving data from data base.

Hi All, I am having trouble through, I am reading the input from tab delimited file containing several records, e.g. line1 field1 field2 field3 so on.. line2 field1 field2 field3 so on.. .. .. on the basis of certain fields for each record in input file, I have to retrieve... (1 Reply)
Discussion started by: Sonu4lov
1 Replies
Login or Register to Ask a Question