Server Administration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesServer Administration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old November 18th, 2003, 07:26 PM
sankarm sankarm is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 sankarm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
SQL within a Shell Script

Hi,

I need to create a pipe delimited file based on the data in an Oracle table and I need some help/pointers with it.

Here is the table structure:

tableA:

old_id varchar2(255);
new_id varchar2(255);
cdate date;
mdate date;
cflag char(1);

The shell sript should do the following:

1. connect to the database.
2. set the flag to Z if it is an N.
3. write old_id and a pipe sign.
4. write the new_id.
5. set the mdate to the current date.
6. The cflag which is Z should be set to Y once my file is created.

This running Oracle 9 on Solaris 9 OS.

Any help would be greatly appreciated.

Thank you,
Sankar.

Note: This is my first post here. I hope my question is acceptable. If not, my apologies in advance. Thanks.

Reply With Quote
  #2  
Old December 4th, 2003, 02:28 AM
boogiemin boogiemin is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 9 boogiemin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: SQL within a Shell Script

Check to if there is a command-line tool for interacting with Oracle. There probably is, and you probably already know what it's called and how to use it. In the Linux world, MySQL and PostgreSQL both have these (they're called mysql and psql, respectively).

If you can utilize the command line tool to execute Oracle SQL statements, then you could create a shell script (bash or whatever) to accomplish your goals. I am not familar with Oracle, but with postgres, the command would look something like this:

psql -d yourdbname -U postgres -c "QUERY;"

best wishes...

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesServer Administration > SQL within a Shell Script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway