Added readSql function