sql="select count(*) from scontractamd where contract_no = ? and amd_no <> ? and (confirmed <> 'Y' or confirmed is null) and (status <> 'X' or status is null)";
sql="select max(nvl(min_rate,0)) from pricelist where price_list = ? and item_code = ? and list_type = 'L' and eff_from <= ? and valid_upto >= ? and min_qty <= ? and max_qty >= ?";