James Buchanan actually said...
My prayer to God is that He would preserve the Constitution and the Union throughout all generations.
Context
Fourth Annual Message to Congress on the State of the Union
12/02/1860
Fourth Annual Message to Congress on the State of the Union
12/02/1860