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

Select * from celltable

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

I have this but it doesn't work

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

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