General discussion


Missing semicolon at end of SQL statement.

By arobin4 ·
Good morning,
Any suggestions? I keep getting the following error when I try to INSERT data into my databse from my asp webpage. Here is the code that produces the error:

MM_editQuery = "insert into Clarify_Case_Number (engineer_id) values (10),(20),(30);"

If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute ' ** Code fails here **

I am trying to insert 10, 20, and 30 into the engineer_id column when the code executes.


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

wrong dimension

by john_wills In reply to Missing semicolon at end ...

I think what you have instructed the engine to do is insert 3 values into a single column. If you need to insert 3 new rows, each with a different value in a particular column, you must INSERT 3 times. But shouldn't this be in Technical Q & A?

Collapse -

Missing semicolon at end of SQL statement.

by arobin4 In reply to wrong dimension

Good afternoon. I'm new to TechRepublic, I thought this message got posted to "Client Support". Thanks for replying. I an trying to insert multiple records from webpage at one time. The values are selected from a webpage list box. User can select several item from box (by holding ctrl-key). I won't always know how many records need to be inserted. I am looking for a method to insert each selection as a seperate record. I found a clue at: //">

but I kept getting that error. Any help is much appreciated.


Related Discussions

Related Forums