The first five books of the Bible are called ‘Law’ (torah) in Hebrew, but only parts of the second to the fifth can strictly claim that title. Modern study generally recognizes different strata of law from differing periods. The earliest is the so-called Book of the Covenant (Exodus 21–3); a later Deuteronomic code is contained in the book of that name; and the latest, the so-called Priestly legislation is scattered through Exodus, Leviticus, and Numbers. Laws and legal matter survive from other ancient Near Eastern nations, mostly from Mesopotamia and in cuneiform. What can be called ‘codes’, though some quibble at the term, are the following:
(i) Sumerian, from Ur-Nammu or Shulgi, kings of Ur, c.2100–2050 BCE
(ii) Sumerian, from Lipit-Ishtar of Isin, c.1930 BCE
(iii) Babylonian, from the town of Eshnunna, c.1770 BCE
(iv) Babylonian, from Hammurabi of Babylon, c.1750 BCE
(v) Hittite, c.1650–1500 BCE
(vi) Assyrian, c.1300–1100 BCE
There is a tradition within these codes. Laws are copied from the earlier into the later, often with more explicit wording or other amplification. The length of the codes also usually increases with passage of time, Hammurabi's being the longest of the surviving ones. The Assyrian was apparently much longer still, but little remains. In addition to the codes, kings also promulgated legal decrees for particular economic purposes—for example, by cancelling certain types of debt. Examples are known from Uru-inimgina of Lagash (Sumerian, c.2400 BCE) and from various Mesopotamian kings (in Babylonian) c.2000–1500 BCE. Finally, thousands of court case records survive from c.2100–1600 especially, showing how justice was in fact dispensed.
Some striking points emerge from this material. First, the court records show that generally no particular attention was paid to the existing local code. A bench of magistrates decided each case on its merits, guided by their collective wisdom and accumulated experience. Some laws, in Hammurabi's code especially, are totally impracticable, and could not be enforced. Further, no code is known from otherwise well-documented late Babylonian times. Hammurabi's laws were copied out by scribes as a library text for study by scholars, but not for lawyers. In short, the codes did not provide the rules for everyday life. Secondly, the legal edicts appear to have been formulated for immediate enforcement, but not for perpetuity. If needed, another edict could be issued a few years later.
Biblical laws can be compared only with the Mesopotamian codes of c.2100–1700 BCE, though details of the Hittite and Assyrian codes are also relevant. Their statuses raise questions, of course, about the status of biblical laws in Israel, but do not provide answers. Generally the biblical law is much more concerned with religious life and duties than what we would consider forensic. But comparisons do yield conclusions. The Book of the Covenant is closest to the Mesopotamian codes. Deuteronomy and the Priestly material are more remote. An example: laws nos. 53–5 of the Eshnunna code deal with the goring ox and parallel Exod. 21: 28–32, and in part they are identically worded. Here the Book of the Covenant is clearly based on Near Eastern traditions. But only Hammurabi's laws nos. 196–203 lay down the lex talionis (‘eye for eye, tooth for tooth’); previous codes prescribe fines for bodily injury. Hammurabi was an Amorite, and the lex talionis is more suited to desert life than urban life with courts and magistrates. Presumably both Hammurabi and the Book of the Covenant depend on the same Amorite custom.
Legal documents from Nuzi (c.1450–1400 BCE, near Kirkuk, with much Hurrian influence) have been pressed as illustrating patriarchal society, but the case has been exaggerated. The archives of Mari (c.1800 BCE, on the Euphrates close to the modern Iraqi–Syrian border) have also been pressed for revealing an Amorite society with parallels to the patriarchal narratives. There is more that is valid here, but in the linguistic rather than legal sphere.