LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-04-2019, 11:44 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,561

Rep: Reputation: 177Reputation: 177
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?
 
Old 02-05-2019, 02:30 AM   #2
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,561

Original Poster
Rep: Reputation: 177Reputation: 177
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.

Last edited by mfoley; 02-06-2019 at 03:44 PM.
 
  


Reply

Tags
error, mysql, update



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert fields in one column to single line using common field separator in the column say_hi_ravi Linux User Groups (LUG) 3 08-09-2017 06:56 AM
How to print lines in csv file if 1 csv column field = "text". There are 10 column (;) in csv file nexuslinux Linux - Newbie 9 04-22-2016 11:35 PM
How to display 2 different column field values as one column value in mysql VijayaRaghavanLakshman Linux - General 2 04-16-2012 09:56 AM
[SOLVED] awk: how to print a field when field position is unknown? elfoozo Programming 12 08-18-2010 03:52 AM
error unknown column 'xxx' in field list rajesh84210 Linux - Newbie 4 09-07-2009 11:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration