How to connect DB2 table using shell script

Hi All,

I want to connect two tables in DB2 using shell script and then compare the contents of two tables field by field. Could any one please help me in connecting database tables using Unix and retriving data from the same.

Thanks,
Durwas