Unable to update table, but select works

Araw

I`m facing a weird problem in MySQL, I try to update a value in a table that exists, but get an error that the table doesn't exists even though it does. The SELECT statement works fine:

mysql> SELECT * FROM CurrentState;
+----+------------+--------+--------+
| ID | last_price | buyer  | seller |
+----+------------+--------+--------+
|  1 |       5.10 |   5.09 |   5.12 |
|  2 |     132.00 | 130.30 | 132.40 |
+----+------------+--------+--------+
2 rows in set (0.00 sec)

mysql> UPDATE CurrentState SET buyer = buyer;
ERROR 1109 (42S02): Unknown table 'CurrentState' in field list

I have tried doing the query as a regular user and as root and I get the same results. What can the problem be? The only thing I have done is that I have created a trigger for the table in case an update statement is executed. But now that isn't even possible.

Thanks for any help!

EDIT: Added trigger

CREATE TRIGGER push_changes AFTER UPDATE ON CurrentState FOR EACH ROW CALL winners_change(CurrentState.buyer,CurrentState.seller,CurrentState.last_price);

As I write this I guess the problem is the (CurrentState.buyer,CurrentState.seller,CurrentState.last_price); part, should CurrentState be removed?

redmoon7777

You should use NEW instead of CurrentState to reference the current row.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Unable to select table in mysql

From Dev

unable to update the ngmodel of select list

From Dev

unable to update the ngmodel of select list

From Dev

Unable to update a column in a table on register

From Dev

Update MySQL table based on select

From Dev

Update row with select on same table

From Dev

Update on a table with DISTINCT SELECT in mysql

From Dev

UPDATE psql table with SELECT in json

From Dev

UPDATE and SELECT to/from the same table

From Dev

Update on a table with DISTINCT SELECT in mysql

From Dev

update and select from a database table

From Dev

mysql update with select same table

From Dev

MySQL Update table with Select/Join

From Dev

Update statement with select to another table

From Dev

UPDATE psql table with SELECT in json

From Dev

select from table and update another table SQL

From Dev

update and select query together to update table data from same table

From Dev

Unable to update table using hibernate spring mvc

From Dev

Unable to update extra attribute in join table in Rails

From Dev

Unable to update table through CurrentDb.Execute

From Dev

Unable to update table using PHP Script

From Dev

unable to update DB2 table

From Dev

Unable to Update Table from Stored Procedure in MySQL

From Dev

unable to update SQL table with php program

From Dev

My SELECT statement works, but I'm unable to DELETE

From Dev

jQuery is unable to select cells outside table

From Dev

Unable to select data from another joined table

From Dev

Why does SELECT FOR UPDATE works only within a transaction?

From Dev

Select works in Sqlite Database but Insert and Update statements do not