I have this table called iowe
. It has been created and exists in my database. This is how it looks like:
NAME AMOUNT Serial Number ---------- ---------- ------------- Praveen 20500 Roshan 5000 2 Rohit 5000 3 Shashi 7500 4
When I try to update the Serial Number corresponding to the name Praveen, by inputting the command
update table iowe
set "Serial Number" = 1 where amount = 20500
or
update table iowe
set "Serial Number" = 1 where name = 'Praveen'
I get the following error: ORA-00903: invalid table name
Other commands execute fine on this table.
Rewrite your SQL to include a valid table name. To be a valid table name the following criteria must be met: The table name must begin with a letter. The table name can not be longer than 30 characters.
Remove the word "table" from your update statement:
update iowe
set "Serial Number" = 1
where name = 'Praveen'
You don't need the keyword table
in an update statement:
update iowe
set "Serial Number" = 1
where amount = 20500
As you have it, it's looking for a table called 'table
', while giving it the alias 'iowe
'.
Not relevant to the question, but I would also really advise not giving objects mixed-case or non-standard names, since you have to quote them - as you are with "Serial Number"
. I have yet to see a case where the added complication and opportunities for confusion can be justified.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With