if (that.results[1].rows.length<1) { {error: new Error("no data got for readtypatt")} } else { var ca = that.results[1].rows; for (var ri=0; ri<ca.length; ri++) { that.query.instance[ca[ri][2]]=ca[ri][3]; that.query.instance[ca[ri][2]+"_DESC"]=ca[ri][4]; } }