![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script information needed | chris1234 | UNIX for Dummies Questions & Answers | 3 | 12-17-2007 03:35 PM |
| Shell Script: want to insert values in database when update script runs | ring | Shell Programming and Scripting | 1 | 10-25-2007 12:06 AM |
| Script execution information | manthasirisha | Shell Programming and Scripting | 12 | 07-07-2006 05:54 AM |
| SunWS_cache: Information: Database is locked, waiting | RishiPahuja | High Level Programming | 3 | 09-16-2005 09:58 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
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)? |
| Forum Sponsor | ||
|
|
|
|||
|
Quote:
############################################## 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 " |