1

After creating a table I would like to insert data but I've encountered an error.

Creating the table:

CREATE TABLE "Buildings"(
  "idBuilding" Integer NOT NULL,
  "buildingName" Varchar2(30 ) NOT NULL,
  "city" Varchar2(30 ) NOT NULL,
  "street" Varchar2(30 ) NOT NULL,
)

and then

INSERT INTO Buildings VALUES(1, 'Empire State', 'New York', 'West');

and the error is

SQL Error: 00942. 00000 -  "table or view does not exist"

I know that there are a lot of similar questions here but I couldn't find any solution. I've tried using GRANT and it didn't help. I'm using Oracle SQL Developer.

2
  • You're creating a table named "Building", but inserting into a table named "Banki"? Commented Apr 30, 2017 at 19:51
  • @Waterstraal that was a mistake. I've edited the post. Commented Apr 30, 2017 at 19:58

3 Answers 3

1

Since you created the table with quotes and some lowercase letter, you have to use quotes in your insert statement as well. "Buildings" instead of Buildungs.

Identifiers are case sensitive in Oracle, but identifiers without quotes are automatically turned to uppercase. Therefore, "ABC"=ABC=Abc=abc

Sign up to request clarification or add additional context in comments.

Comments

1

It's a bug in Oracle that adding values' of names with " symbol at the start and at the end of an object's name doesn't show its' symbol in database but it's still somehow saved in database.

Try:

INSERT INTO "Buildings" VALUES(1, 'Empire State', 'New York', 'West');

1 Comment

Not a bug.without quotes, names are turned to uppercase.
0

Well per your latest edit, check and make sure that you have selected the correct database under which you have created the table named Buildings.

See this post How to Query Database Name in Oracle SQL Developer?

3 Comments

My bad, I've pasted the wrong command and made a typo. Table name is "Buildings" and I'm trying to insert into Buildings. I've edited my post.
how to do it? I'm quite new when it comes to DB. I'm inside my .sql file and when I click on the left on Tables I can see all of my created tables.
@codddeer123, see edit again and search in SO or Google

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.