I create a table and wanted to drop the table, but i keep getting error
code ORA-00903 and i am using the admin account.
drop table "Engineers" - you've created a Case Sensitive object name, or someone has, and now you have to deal with it going forward anytime you want to work with it.
When creating things in Oracle, best not to quote the object names.
create table "Engineers" (a integer); -- not a good practice in Oracle...for reasons you have already seen
drop table engineers;
drop table Engineers;
drop table ENGINEERS;
drop table "Engineers"; -- this will work
Run that -
Table "Engineers" created.
Error starting at line : 3 in command -
drop table engineers
Error report -
ORA-00942: table or view does not exist
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Error starting at line : 4 in command -
drop table Engineers
Error report -
ORA-00942: table or view does not exist
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Error starting at line : 5 in command -
drop table ENGINEERS
Error report -
ORA-00942: table or view does not exist
00942. 00000 - "table or view does not exist"
*Cause:
*Action:
Table "Engineers" dropped.
use the following key drop for deleting table
drop table tablename
Related
I'm trying to truncate a table in redshift but it's throwing the following error -
SQL Error [500310] [42501]: Amazon Invalid operation: must
be owner of relation table;
I have already granted all the privileges on the table to the user. As checked through the online documentation for redshift, I can't grant the truncate table access explicitly like the way it's enabled now in PostgreSQL. Is there a way or a best practice to handle this scenario?
As you say only the table owner or a superuser can truncate a table. There are several options.
Change the table to be owned by the user that needs to truncate but this may not meet other constraints
Alter table to current user, truncate, and alter it back to the previous user (requires DROP permission)
Drop and recreate the table but this may break dependencies
Make a table LIKE the original, perform an ALTER TABLE APPEND to this new table, and then drop the new table (some restrictions like no identity columns)
The first image is of the table. I keep getting an error saying what im trying to insert into the table is not the same as what is in
the table. I
The second image is where I have inserted into the table.
[1]: https://i.stack.imgur.com/kIFw6.png
[2]: https://i.stack.imgur.com/ZD8Pv.png
the screenshots show that you are inserting into a different table than the one you are creating.
You create table INVOICE_P but you insert into INVOICE.
Most likely the table INVOICE has a different number or type of columns than INVOICE_P, so Db2 will throw the sqlcode -117 exception.
Try inserting into INVOICE_P instead.
How do we partition a table created using the CREATE TABLE AS command in PostgreSQL. I tried the following:
CREATE TABLE schema.table2 AS TABLE schema.table1 PARTITION BY LIST(col1)
but it gives this error:
ERROR: syntax error at or near "PARTITION"
That's not possible.
CREATE TABLE AS is different from CREATE TABLE and only supports a subset of features for the latter.
I’m trying to drop temporary tables created by Redshift.
I use the following query to find all the temp tables in the cluster:
select name, count(distinct id)
from stv_tbl_perm
where temp = 1
group by 1
The table i'm trying to drop called $stg_inappshourly.
I've tried to drop it in both of the following methods:
drop table $stg_inappshourly
drop table stg_inappshourly
The first one returns a syntax error. The second one drops the actual table.
Any ideas how to drop it?
Solved.
The reason this table kept existing is because its session had an error and it didn't close as expected.
The only way I found to remove this table was rebooting the Redshift instance.
I'm working on HBase 0.98.12-hadoop2 and phoenix-4.7.0
I created table on phoenix to map with existing table on HBase.
After index testing, It failed to drop table with ERROR.
Error: ERROR 1010 (42M01): Not allowed to mutate table. tableName=my_table (state=42M01,code=1010)
To fix this, I tried to set immutable_rows to true but it didn't work.
0: jdbc:phoenix:localhost:2181:/hbase> alter table "my_table" set immutable_rows=false;
16/07/25 17:04:42 WARN query.ConnectionQueryServicesImpl: Attempt to cache older version of my_table: current= 3, new=3
No rows affected (0.041 seconds)
0: jdbc:phoenix:localhost:2181:/hbase> drop table "my_table";
Error: ERROR 1010 (42M01): Not allowed to mutate table. tableName=my_table(state=42M01,code=1010)
How can I drop it? Any advice would be appreciated.
I take a look into SYSTEM.CATALOG and I found something strange.
I don't know why and when it was inserted into there though,
after deleting it I could finally drop the table.
There has to be some kind of reference to the table you are going to drop.
In my case there was a view that was referencing the table, so, first thing was to execute the drop view to delete that reference and after that the drop table command worked.