We found the problem. There are security settings in Moodle which, if tuned on, causes it to look for certain SQL keywords in order to protect against SQL injection. We turned them off.
Question Authors' Forum
Problem creating a table in SQL question
This forum has a limit to the number of forum postings you can make in a given time period - this is currently set at 5 posting(s) in 1 day