12 May the LORD give you discretion and understanding when he puts you in command over Israel, so that you may keep the law of the LORD your God.

Read 1 Chronicles 22:12 Using Other Translations

Only the LORD give thee wisdom and understanding, and give thee charge concerning Israel, that thou mayest keep the law of the LORD thy God.
Only, may the LORD grant you discretion and understanding, that when he gives you charge over Israel you may keep the law of the LORD your God.
And may the LORD give you wisdom and understanding, that you may obey the Law of the LORD your God as you rule over Israel.