0

I create a database with the name Test. There is a table named Banks , that exists and also have data. I generate this table by using EF core in asp.net core api project.

When I try to create a stored procedure GetAllEntities , I get an error

Table or View does not exist

create or replace NONEDITIONABLE PROCEDURE GetAllEntities (
    p_cursor OUT SYS_REFCURSOR
)
AS
BEGIN
    OPEN p_cursor FOR
    SELECT * FROM Banks;
END GetAllEntities;

Can anyone help to find out the solution for it?

MT0
  • 143,790
  • 11
  • 59
  • 117
M Ali
  • 11
  • 4

1 Answers1

1

I suspect it is about letter case. Oracle is case-insensitive, unless you created table (or any other object) by enclosing its name into double quotes.

For example:

SQL> create table "Banks" (id number);

Table created.

SQL> insert into "Banks" values (1);

1 row created.

SQL> select * from "Banks";

        ID
----------
         1

Now see this: I followed letter case (capital "B", lower "anks"), but - without double quotes - that table doesn't exist:

SQL> select * From Banks;
select * From Banks
              *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL>

Therefore, that might be the case in your procedure as well. I noticed you used Banks, but without double quotes. If you add them:

SQL> create or replace PROCEDURE GetAllEntities (
  2      p_cursor OUT SYS_REFCURSOR
  3  )
  4  AS
  5  BEGIN
  6      OPEN p_cursor FOR
  7      SELECT * FROM "Banks";       --> here
  8  END GetAllEntities;
  9  /

Procedure created.

SQL>

This might, or might not be reason for error you got. If what I wrote doesn't help, please, post some more info - especially, prove that table whose name is Banks exists in schema in which you're creating that procedure.

Littlefoot
  • 131,892
  • 15
  • 35
  • 57