I'm writing a KSH shell script that's using SQL though DB2.
If I have a table defined and populated
db2 "create table tb(num int,letter char(4))"
db2 "insert into tb values(111,a)
db2 "insert into tb values(112,b)
db2 "insert into tb values(111,c)
How can I check if a letter user input in my shell script matches a particular number?
So
echo "enter ltr"
read ltr
db2 "select letter from tb where number = 111"
if [ltr = ... '* how do i check if the letter the user input is one of those that matches for 111?
Also, how can I figure out the biggest number value in the table and insert it into a variable in the shell script?