Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

SQL Error: ORA-00933: SQL command not properly ended. When using a simple insert

When trying to execute the following command through my ASP.NET application, the error SQL Error: ORA-00933: SQL command not properly ended is thrown.

The statement: insert into SOMETABLE (GROUPID, USERID, REMOVED) values ('00000000000000000000000000000000', '00000000000000000000000000000000', 0);

However, if I run the exact same statement directly against the DB using SQL Developer, it works.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

All of the articles I’ve read about this involve statements using additional criteria like order by, join, etc.

My connection strings are correct, and other statements are executing fine.

I’m feeding the statement to the database using DbContext.Database.ExecuteCommand():

string command = "insert into SOMETABLE (GROUPID, USERID, REMOVED) values ('00000000000000000000000000000000', '00000000000000000000000000000000', 0);";

int result = context.Database.ExecuteSqlCommand(command);

Why is this happening, and how can I fix it?

>Solution :

Remove semi-colon, here:

string command = "insert into SOMETABLE (GROUPID, USERID, REMOVED) values 
('00000000000000000000000000000000', '00000000000000000000000000000000', 0);";
                                                                           ^
                                                                           |
                                                                        here
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading