fixed sql call for attributemap creation