ExecuteSqlRaw() complains invalid SQL statement, but it's not

390 Views Asked by At

I have a call:

BackFill = "EXEC SYSDBA.BACKFILL('64907RM9')";

_context.Database.ExecuteSqlRaw(BackFill);

I have tried the statement in Oracle SQL Developer, and it works. However, when I try to run it via ExecuteSqlRaw(), Oracle complains throws an ORA-00900 invalid SQL statement

What did I do wrong? Thanks!

UPDATE:

I change the SQL statement to below:

begin SYSDBA.BACKFILL('64907RM9'); end;

Now, I am getting identifier SYSDBA.BACKFILL must be declared...but it is.

1

There are 1 best solutions below

3
Littlefoot On BEST ANSWER

It means that user SYSDBA doesn't own BACKFILL procedure. If you, by any chance, created it using double quotes and lower/mixed case, you'll have to do that again (i.e. reference it with double quotes and match letter case).

Otherwise, if you're running it connected as another user (not SYSDBA), make sure SYSDBA granted you EXECUTE privilege on it.