1

When trying to execute the following command through my ASP.NET application, I get an error

SQL Error: ORA-00933: SQL command not properly ended

The statement is:

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.

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 this code:

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?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
JEJoll
  • 547
  • 1
  • 6
  • 20
  • Does this answer your question? [SQL Error: ORA-00933: SQL command not properly ended](https://stackoverflow.com/questions/8940471/sql-error-ora-00933-sql-command-not-properly-ended) – Igor Aug 05 '22 at 18:01
  • No, I already looked at that article, but thanks. I've selected the correct answer below. It was a semi colon... – JEJoll Aug 06 '22 at 01:43
  • 1
    The marked answer in https://stackoverflow.com/a/33291713/1260204 is the same, it is to remove the `;` character. – Igor Aug 06 '22 at 19:34

1 Answers1

2

Remove semi-colon, here:

string command = "insert into SOMETABLE (GROUPID, USERID, REMOVED) values 
('00000000000000000000000000000000', '00000000000000000000000000000000', 0);";
                                                                           ^
                                                                           |
                                                                        here
Littlefoot
  • 131,892
  • 15
  • 35
  • 57