![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | 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 |
| print selected rows with awk | tonet | Shell Programming and Scripting | 6 | 09-27-2007 03:23 AM |
| splitting a column into rows | spindoctor | UNIX for Dummies Questions & Answers | 3 | 07-24-2007 12:25 PM |
| return number of rows selected | new2ss | Shell Programming and Scripting | 7 | 01-08-2007 06:46 AM |
| Factorize some rows in a column | frebo | UNIX for Dummies Questions & Answers | 5 | 03-21-2006 02:41 AM |
| Cutting rows after a selected point | nhatch | Shell Programming and Scripting | 4 | 09-05-2003 07:14 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
flags to suppress column output, # of rows selected in db2 sql in UNIX
Hello,
I am new to db2 SQL in unix so bear with me while I try to explain the situation. I have a text file that has the contents of the where condition that I am using for a db2 SQL in UNIX ksh. Here is the snippet. Code:
if [ -s /entH/temp/VALUE$$.out ];
then
echo "Begin processing VALUEs"
db2 connect to testdb2 user username using passwd
while read line
do
echo "Processing VALUE $line"
snrf=$(echo $line | awk -F "." '{print $1}')
db2 "select document_name, document_type, timestamp_date, loc_code, box_number_from from edv.evctr1 where transaction_id = ${VALUE}" >> /entH/temp/${VALUE}_control_data.$$
echo "EOF1" >> /entH/temp/${VALUE}_control_data.$$
db2 "select comments from edv.evcmt1 where transaction_id = ${VALUE}" >> /entH/temp/${VALUE}_control_data.$$
done < /entH/temp/VALUE$$.out
fi
Code:
document_name document_type, timestamp_date, loc_code, ... ------------- ------------- -------------- ------------- ... col1_value1 col2_value1 col3_value1 col4_value1 ... 1 record(s) selected. EOF1 comments ------------------------------------------ comment_value1 comment_value2 comment_value3 3 record(s) selected. For instance in oracle you can use something like, set heading off, set feedback off, set linesize 200, COL column_name format format_specifier etc. If there are flags that can be set, how can I incorporate it in a shell script or is there a ini file that needs to be used? Any help provided is greatly appreciated. Many thanks. Jerardfjay |
| Forum Sponsor | ||
|
|
|
|||
|
use -x option
For those of you who are interested.
Use the command line option -x to suppress printing of column headers and feedback from the SQL engine other than the desired data output. Courtesy of IBM web site. More information can be found here. DB2 - UDB command line options Jerardfjay |
|||
| Google UNIX.COM |