The present invention relates to formula (I): (I) [wherein each symbol is as defined in the specification. Or a prodrug thereof, a prophylactic / therapeutic agent for diabetes, obesity, etc., and a glucokinase activator.本発明は、式(I):(I)[式中の各記号は、明細書記載と同意義である。]で表される化合物もしくはその塩またはそのプロドラッグを含有してなる糖尿病、肥満等の予防・治療剤、グルコキナーゼ活性化剤を提供する。