Page 1 of 1

[Solved] Table not found in statement

Posted: Mon Jul 24, 2017 7:34 pm
by Skrag
Dear all,

This seems like an easy problem, so I hope it hasn't been answered yet. At least I didn't find an answer.

I want to update my table und fill a newly created column with the default value. I use the following SQL code:

UPDATE TABLE "tblExample" SET "Embedded" = 0

It gives me this error message: "1: Table not found in statement [update table]"

Both table and column exist. I tried giving it "0" instead of 0 as a value, it doesn't help. I also tried reopening the database. The database is embedded, HSQL engine. The column is a foreign key, but I made sure that the desired value respects the integrity. Entering the value manually works. The command type ALTER TABLE works.

What am I doing wrong?

Re: Table not found in statement

Posted: Mon Jul 24, 2017 8:01 pm
by UnklDonald418
The keyword TABLE in your statement isn't needed. Try

Code: Select all

UPDATE "tblExample" SET "Embedded" = 0;

Re: Table not found in statement

Posted: Tue Jul 25, 2017 1:53 pm
by Skrag
Alright, now I feel stupid. I shouldn't ask stuff like this after a long day. I probably thought about the "ALTER"-commands and tried to do it in a parallel way. Thanks though!

Re: Table not found in statement

Posted: Mon Dec 12, 2022 12:32 pm
by Shlok
UnklDonald418 wrote: Mon Jul 24, 2017 8:01 pm The keyword TABLE in your statement isn't needed. Try

Code: Select all

UPDATE "tblExample" SET "Embedded" = 0;
Sir,
can you help me for the same please.
Even I am trying to update my table but it is showing the problem table not found.
I typed -
update Students set Marks=850 where Roll_No=103;

Here table = Students
Field names are Marks and Roll_No
How to solve this problem?

Re: Table not found in statement

Posted: Mon Dec 12, 2022 4:11 pm
by charlie.it
Did you use double quotes?

Code: Select all

UPDATE "Students" SET "Marks"=850 WHERE "Roll_No"=103;

Re: Table not found in statement

Posted: Mon Dec 12, 2022 4:14 pm
by Sliderule
Shlok wrote:update Students set Marks=850 where Roll_No=103;
The above should be

Code: Select all

update "Students" set "Marks"=850 where "Roll_No"=103;
Explanation:
  1. Since you are using Mixed Case, NOT ALL UPPER CASE letters for both Tables and Column Names, they must be surrounded by double quotes ( " ) .
  2. Just as an addition FYI ( For Your Information ), since an UPDATE statement is NOT a Query, it must be run from the menu: Tools -> SQL...
I hope this helps, please be sure to let me / us know.

Sliderule