Getting error not able remove the record


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Getting error not able remove the record
# 1  
Old 01-28-2016
Getting error not able remove the record

Code:
export PATH=$PATH:/opt/IBM/db2/V9.5/95fp4/bin
DB2INSTANCE=bancbcb1
export DB2INSTANCE
db2 "connect to dyaxprpt user xyz using byx"
echo "Load lastest data start"
Row=$(db2 –x “delete from xyz.ROL_yxpwhere axl_ING_ID in(50127,50455,503458,175748)”) 
If [ $Row == 0 ] ; then 
echo “no data deleted”
elif [ $Row > 0 ]; then
echo “$Row data deleted ”
fi

getting error in if else condition

Last edited by Franklin52; 01-28-2016 at 08:03 AM.. Reason: Please use code tags
# 2  
Old 01-28-2016
try:
Code:
if [ "$Row" = 0 ]

# 3  
Old 01-28-2016
Code:
if [ $Row -eq 0 ]

elif [ $Row -gt 0 ]

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to remove space from each record in file?

Hi , I want to remove space from each record in one file My file is like BUD, BDL ABC, DDD, ABC ABC, DDD, DDD, KKK The o/p should be BUD,BDL ABC,DDD,ABC ABC,DDD,DDD,KKK Can any one help me regarding this? (9 Replies)
Discussion started by: jagdishrout
9 Replies

2. Shell Programming and Scripting

Remove \n at the beginning of a field in a record.

Hi, In my file, I have few records which are split across multiple lines. File 1: ===== james,\n pre-auth completed,in patient,\n Fac_Id:23451,ramson,Dallas Expected is: ========== james,pre-auth completed,in patient,Fac_Id:23451,ramson,Dallas (8 Replies)
Discussion started by: machomaddy
8 Replies

3. Shell Programming and Scripting

How to Remove the new line character inbetween a record

I have a file, in which a single record spans across multiple lines, File 1 ==== 14|\n leave request \n accepted|Yes| 15|\n leave request not \n acccepted|No| I wanted to remove the '\n charecters. I used the below code (foudn somewhere in this forum) perl -e 'while (<>) { if... (1 Reply)
Discussion started by: machomaddy
1 Replies

4. Shell Programming and Scripting

Remove carriage return in a record

Hi all gurus, I need help in removing carriage return existed within a record delimited by pipe <|>. Sample: A_01|Test1|Testing1|Remarks1 A_02|Test2|Test ing2|Remarks2 A_03|Test3|Testing3| Remarks3 Desire output: A_01|Test1|Testing1|Remarks1 A_02|Test2|Testing2|Remarks2... (10 Replies)
Discussion started by: agathaeleanor
10 Replies

5. Shell Programming and Scripting

To remove a particular record from File

Dear Friends, Need your help to fix the issue we are facing. We have a requirement - Need to remove specific records from a comma separated file and create new file. It should check "filter.csv" file and then accordingly remove records from the input file and generate the output file.(not case... (5 Replies)
Discussion started by: SatishW
5 Replies

6. Shell Programming and Scripting

Remove particular record from a file

Hi:), I am having 110 records in a file and I want to delete particular record (say 63rd) . Which command can be use to achieve this ? (4 Replies)
Discussion started by: devmns
4 Replies

7. UNIX for Advanced & Expert Users

To remove the record from a file

Hi , In need to remove the record marked in red My input is as below : 1|ETG|63121387883|Alternate|Y 2||| 3|79.58|||GBP|| 4|001137001 4|0011372 5|1021701 5|1021901 1|ETG|63121387884|Alternate|Y 2||| 3|79.58|||GBP|| 4|001137001 5|1021702 5|1021802 1|ETG|63128363077|Alternate|Y 2|||... (1 Reply)
Discussion started by: laxmi131
1 Replies

8. Shell Programming and Scripting

How to remove a particular record from a file?

Please tell me the command(s) to remove a particular record from the file and placing the rest of the record in a seperate file. (9 Replies)
Discussion started by: kanu_pathak
9 Replies

9. UNIX for Dummies Questions & Answers

Remove First and Last Record from a file

Hi All, Could some one help me how to delete first & last record from a file Thanks in Advance....... Regards Cherrry (1 Reply)
Discussion started by: ravikuc
1 Replies

10. UNIX for Dummies Questions & Answers

command to remove last record on file

Hi, First time on the forum. I have converted some files using the Unix to DOS command but need to strip off the last record that is generated from this conversion that contains just a ^Z. Is there any command that would accomplish this without having to do stream editing? (4 Replies)
Discussion started by: mheinen
4 Replies
Login or Register to Ask a Question