Re: SQL Error (1241): Operand should contain 1 column(s)
Posted by: Abhishek Gupta
Date: February 15, 2021 03:52AM

Hi Peter,

As I was working more in this direction, I found where the mistake was. Sorry not hit my mind at first place but will also make you understand why I am asking about debugging and useful tools of any sort.

The problem was that a trigger is associated with the table.

============================================================================================================================================================

create trigger tr_ftr_ins_NMId_FTRIdentifier
before insert
on t_ftr for each row
begin
SET @minftrid = (select min(itf.FTRId) as minftrid, itf.NMId, itf.FTRIdentifier from T_FTR itf where itf.NMId = new.NMId and itf.FTRIdentifier = new.FTRIdentifier group by itf.NMId, itf.FTRIdentifier having count(1) > 1);
update t_ftr tf SET tf.FTRIdentifier = NULL where tf.NMId = new.NMId and tf.FTRIdentifier = new.FTRIdentifier and tf.FTRId > @minftrid;
end$$

============================================================================================================================================================

SET @minftrid = <Returning multiple columns from select>

============================================================================================================================================================


But I believe this is just accidental. Hence will appreciate if you can answer below question

============================================================================================================================================================

Q1. Are there any open source/freeware tools that can help me diagnose this or similar kind of problem/s, like what part of SQL query is leading to that error, stored procedure debugging tool etc.

Q2. With that said, I will appreciate if you can mention or point me to a link, that list general and useful tools/utilities a MySQL DBA and Developer should know about.

Thanks|Regards
Abhishek G

Options: ReplyQuote


Subject
Written By
Posted
Re: SQL Error (1241): Operand should contain 1 column(s)
February 15, 2021 03:52AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.