[Solved] Table already exists error in base

Creating tables and queries
Post Reply
AkshatTumkur
Posts: 3
Joined: Mon Mar 29, 2021 11:38 am

[Solved] Table already exists error in base

Post by AkshatTumkur »

i run this command -

create table "students"("Name" char(20), "ad.no"numeric(4), "marks"numeric(3));

the command is successfully executed

now i run this command -

insert into "students"(Name, ad.no, marks)
values('Akshat','6183','99');

And i get this error -

Table already exists: students in statement [create table "students"]
2021-03-29.png
Pls help
What did i do wrong ?
In fact I opened a new base and executed these commands and did ot create a single table earlier

Thanks in advance
(btw i am a beginner)
Last edited by AkshatTumkur on Mon Mar 29, 2021 12:52 pm, edited 2 times in total.
open office version 4.1.9
my OS - Win 10 pro
User avatar
Villeroy
Volunteer
Posts: 31270
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Table already exists error in base

Post by Villeroy »

Try menu:View>"Refresh Tables"
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
AkshatTumkur
Posts: 3
Joined: Mon Mar 29, 2021 11:38 am

Re: Table already exists error in base

Post by AkshatTumkur »

I have done that !!
The table has been created and I am able to view it too but when I am trying to insert the values I am unable to
open office version 4.1.9
my OS - Win 10 pro
User avatar
Villeroy
Volunteer
Posts: 31270
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Table already exists error in base

Post by Villeroy »

This is very weird. Can you enter the values manually?

I doubt that your syntax causes causes this error, but it should be:

Code: Select all

insert into "students"("Name", "ad.no", "marks")
values('Akshat',6183,99);
with double-quotes around names and numbers without single quotes.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Villeroy
Volunteer
Posts: 31270
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Table already exists error in base

Post by Villeroy »

Now I see what's wrong. You screenshot indicates that you are running both commands together. Once the table has been created, you have to remove the CREATE statement and run the INSERT statement alone.

By the way, your table has no primary key which is why you can't edit the table interactively in Base.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
AkshatTumkur
Posts: 3
Joined: Mon Mar 29, 2021 11:38 am

Re: Table already exists error in base

Post by AkshatTumkur »

Oh yeah thanks!

It works now :)
open office version 4.1.9
my OS - Win 10 pro
Post Reply