This verse refers to the making of the golden calf in Exo 32.1-6. Verse 7a has a strong link to Exo 32.6a, which says “And they rose up early on the morrow, and offered burnt offerings and brought peace offerings.”
Good News Bible‘s translation of the quotation from Exo 32.6b is a vivid paraphrase, the meaning of which may be implied in the Greek but is not expressed. Exo 32.19 refers back to this as dancing rather than as “sex.” Paul treats “sex” in the following verse. The Greek verb that Revised Standard Version translates dance means “play” or “amuse oneself.” Bible en français courant “amuse themselves”; Revised English Bible has “revel.” Other common language translations, also Translator’s New Testament and An American Translation, translate “dance.” However, dancing and sex are connected in many cultures. The Greek word used here for “dance” refers in the Septuagint of Genesis 26.8 to Isaac “fondling his wife” (Isaac and Rebecca making love), but in Genesis 21.9 it has the wider meaning of children “playing,” or it may refer to homosexual contacts. Dance is probably the safer rendering. Paul’s main point is that the feast and the dancing took place, in effect, to honor a pagan god.
The phrase Do not be idolaters will need to be slightly expanded in some languages to “Nor should we worship idols.”
For a discussion on it is written, see the comments on 9.9.
An alternative translation model for this verse is:
• nor should we worship idols as some of those people did. For it is written in the scriptures, “The people sat down to eat and drink (in a feast) and then began to dance.”
Quoted with permission from Ellingworth, Paul and Hatton, Howard A. A Handbook on Paul’s First Letter to the Corinthians, 2nd edition. (UBS Handbook Series). New York: UBS, 1985/1994. For this and other handbooks for translators see here .