The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script information needed chris1234 UNIX for Dummies Questions & Answers 3 12-17-2007 07:35 PM
Shell Script: want to insert values in database when update script runs ring Shell Programming and Scripting 1 10-25-2007 03:06 AM
Script execution information manthasirisha Shell Programming and Scripting 12 07-07-2006 08:54 AM
SunWS_cache: Information: Database is locked, waiting RishiPahuja High Level Programming 3 09-17-2005 12:58 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-26-2008
rollthecoin rollthecoin is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 26
A script pls( To retrieve database information)

KSH - Unix -AIX - db2

**************
Get the input from the user say '123' (It varies)

Then i want to connect to a database say "D1"
then i want th extract from the database by giving "select * from tablename where input = '123'

I also want to connect to another database "D2"
then i want th extract from the database by giving "select * from tablename where input = '123'

output should be displayed on the screen as it is when i execute the select statements individually.
********************************
This is what i want to do in a script

Can you show a script for that(For eg)?
  #2 (permalink)  
Old 04-26-2008
hanu_oracle hanu_oracle is offline
Registered User
  
 

Join Date: Mar 2008
Location: MUMBAI, INDIA
Posts: 41
Quote:
Originally Posted by rollthecoin View Post
KSH - Unix -AIX - db2

**************
Get the input from the user say '123' (It varies)

Then i want to connect to a database say "D1"
then i want th extract from the database by giving "select * from tablename where input = '123'

I also want to connect to another database "D2"
then i want th extract from the database by giving "select * from tablename where input = '123'

output should be displayed on the screen as it is when i execute the select statements individually.
********************************
This is what i want to do in a script

Can you show a script for that(For eg)?

##############################################
Data Base Connection & Get information from DB
##############################################

echo "Enter Input File Name"
read FILE

# To check the value in TABLE_CFS_DUMP table FILE_NAME value

RETVAL=`sqlplus -silent USERNAME/PASSWORD@DBNAME <<EOF
set pagesize 0 feedback off verify off heading off echo off
select * from TABLE_CFS_DUMP where FILE_NAME like '$FILE';
exit;
END`

echo "The DB Query Output is: $RETVAL "
  #3 (permalink)  
Old 04-26-2008
rollthecoin rollthecoin is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 26
Is this a script . Can i have it in a well defined form? please
  #4 (permalink)  
Old 04-26-2008
DukeNuke2's Avatar
DukeNuke2 DukeNuke2 is offline Forum Staff  
Soulman
  
 

Join Date: Jul 2006
Location: Germany, Berlin
Posts: 2,910
this smells like homework.... please read the rules!
Sponsored Links
Closed Thread

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 07:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0