Search This Blog

Thursday, September 8, 2011

#1241 - Operand should contain 1 column(s)


I was trying to run an insert statement something like:
insert into database.table(column1,column2) values ((a,b),(c,d),(e,f));
When i tried to execute this using java code, i got the following error:
#1241 - Operand should contain 1 column(s)

In this case, the error was:
I had added extra round brackets to club all the rows to be inserted which is wrong.
So the correct statement is:
insert into database.table(column1,column2) values (a,b),(c,d),(e,f);

The values were then inserted properly.
There is a possibility that you code has some other issue!

Thanks,
Shoeb

No comments:

Post a Comment