fixed sql_fetchfield in get_chiave_esterna