For an excellent discussion of this type of tale, see Susan Niditch and Robert Doran, “The Success Story of the Wise Courtier,” Journal of Biblical Literature 96 (1977), pp. 179–193.