Ksh Set Variable Sql Query Questions