Provided is a superior, novel heterocyclic compound with improved solubility in oil such as sesame oil and benzyl benzoate, which has a broader treatment spectrum, causes less side effects, and is superior in tolerability and safety, and use thereof. A heterocyclic compound represented by the formula (I) wherein each symbol is as defined in the specification, or a salt thereof.