[1.7.x] Fixed broken tests on Oracle after 5853c87a458f62ebd62d7809168355610de2570c.

Oracle doesn't have a `BEGIN` statement so the test would
fail.

Refs #23303

Backport of 54164b814cab71a8a0503743befbdcc99ae6c7a0 from master.