Recently I attempted to add a column to one of the tables of my database which has 316 table but after the following command:
mysql> ALTER TABLE view_Server ADD rsh_protocol VARCHAR(60);
I get the following error :
ERROR 1347 (HY000): 'itop.view_Server' is not BASE TABLE
all my searches was unsuccessful like using '``'
. So the question is that what's the reason of this error? and how can I git ride of that?
From your "table" name, are you trying to add a column to a view?
Run through each of these:
CREATE TABLE x (id INT, name VARCHAR(255));
INSERT INTO x VALUES (1, 'One');
INSERT INTO x VALUES (2, 'Two');
-- A view with no change of column names
CREATE VIEW y AS SELECT id FROM x;
SELECT * FROM y;
-- Change the view, again using the base table column names
ALTER VIEW y AS SELECT name FROM x;
SELECT * FROM y;
-- Change the view, switching column name from `name` to `theName`
ALTER VIEW y (theName) AS SELECT name FROM x;
SELECT * FROM y;
-- Change the view, switching column name to `anotherName` by aliasing in the SELECT
ALTER VIEW y AS SELECT name anotherName FROM x;
SELECT * FROM y;
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