factorisation of sql code. removed/adapted getAttribut fonction to avoid complex/not easy comprehensible parameter build