LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   MySQL Unknown column 'columname' in 'field list' (https://www.linuxquestions.org/questions/linux-software-2/mysql-unknown-column-columname-in-field-list-4175647635/)

mfoley 02-04-2019 11:44 PM

MySQL Unknown column 'columname' in 'field list'
 
I have a row in MySQL (MariaDB) as follows:
Code:

select orgId, personId, MemberId from orgMember where personId = 252
orgId  personId  MemberId
1      252      252

I want to change the MemberId:
Code:

update orgMember set memberId = 255 where personId = 252 and orgId = 1
ERROR 1054 (42S22) at line 1: Unknown column 'orgId' in 'field list'

I haven't been able to find the reason for this error. orgId and personId are the primary key:
Code:

Field    Type          Null    Key    Default Extra
orgId    mediumint(9)  NO      PRI    NULL
personId  mediumint(9)  NO      PRI    NULL
memberId  mediumint(9)  NO              NULL

What is wrong here?

mfoley 02-05-2019 02:30 AM

Found the problem! I had a trigger on this table that had an invalid syntax with reference to the orgId column. Fixed the trigger and the update worked. Not real obvious from the error that the problem was in the trigger.


All times are GMT -5. The time now is 07:50 PM.