Provided is a substituted piperidine compound having an orexin type 2 receptor agonist activity. A compound represented by the formula (I): wherein each symbol is as described in the DESCRIPTION, or a salt thereof has an orexin type 2 receptor agonist activity, and is useful as a prophylactic or therapeutic agent for narcolepsy.