Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8570451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:33:39+00:00 2026-06-11T18:33:39+00:00

Getting a Operand should contain 1 column(s) mysql error whenever I try to insert

  • 0

Getting a Operand should contain 1 column(s) mysql error whenever I try to insert into the table sets.

I googled and found a hoard of similar questions but they are always pin point specific to solving their immediate problem. I have mysql 5.6 by the way. I am allowed multiple TIMESTAMPS.

Here is my code:

INSERT INTO `sets` (`tabler_name`) VALUES ("leads_auto");

Here is my table:

CREATE TABLE IF NOT EXISTS `lms`.`sets` (
    `set_id` BIGINT NOT NULL AUTO_INCREMENT,
    `on_off` SMALLINT NOT NULL DEFAULT 0,
    `tabler_name` VARCHAR(45) NULL,
    `origin_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `last_modified_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `original_count` INT NULL,
    `current_count` INT NULL,
    `source_type` VARCHAR(45) NULL,
    `source` VARCHAR(45) NULL,
    `method` VARCHAR(45) NULL,
    `agent` VARCHAR(45) NULL,
    `dupes` INT NULL,
    `bads` INT NULL,
    `aged` INT NULL COMMENT 'This table keeps track of the record sets that enter the system.        Example: a set of leads imported into the database.',
    PRIMARY KEY (`set_id`)
) ENGINE = InnoDB;

Stored Procedure:

DELIMITER //

CREATE PROCEDURE `lms`.`leads_to_bak` ()
BEGIN
SET @table1 = (SELECT `tabler_name` FROM sets WHERE on_off=0 LIMIT 1);
SET @table2 = CONCAT(@table1, '_bak');
SET @SQL1 = CONCAT('INSERT INTO ',@table2, '(', (SELECT
REPLACE(GROUP_CONCAT(COLUMN_NAME), 'lead_id,', '') FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = @table2), ')', ' SELECT ', (SELECT                                                                   REPLACE(GROUP_CONCAT(COLUMN_NAME), 'lead_id,', '') FROM INFORMATION_SCHEMA.COLUMNS WHERE       TABLE_NAME = @table1), ' FROM ', @table1);
PREPARE stmt FROM @sql1;
EXECUTE stmt;
END//

DELIMITER ;
USE `lms`;

Trigger

DELIMITER $$

USE `lms`$$

CREATE TRIGGER `lms`.`after_insert_into_leads`
AFTER INSERT ON `sets` FOR EACH ROW
BEGIN
IF (SELECT * FROM sets WHERE on_off=0 LIMIT 1) THEN
CALL lms.leads_to_bak();
END IF;
END$$

DELIMITER ;
USE `lms`;

I don’t see anything wrong with my routines. Removing the routines and trigger seems to make the problem go away.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:33:41+00:00Added an answer on June 11, 2026 at 6:33 pm

    In your trigger, did you mean to put EXISTS after IF? Like this:

    CREATE TRIGGER `lms`.`after_insert_into_leads`
    AFTER INSERT ON `sets` FOR EACH ROW
    BEGIN
    IF EXISTS (SELECT * FROM sets WHERE on_off=0 LIMIT 1) THEN
    CALL lms.leads_to_bak();
    END IF;
    END$$
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Getting a strange error when trying to insert data into an Access database using
I am getting a syntax error Missing operand after 'Price' operator with the following
I m getting the error 'Operator '=' incompatible with operand types 'Boolean' and 'String''
I am getting an error when I try to output the return value from
TypeError: unsupported operand type(s) for /: 'tuple' and 'tuple' I'm getting above error ,
I am getting illegal operand error when I run a program. The program where
Getting 'Dispatcher has no subscribers' error while trying to post message to a channel
Getting this weird LINQ error. title = System.Linq.Enumerable+WhereSelectEnumerableIterator`2[System.Xml.Linq.XElement,System.String Here is the code I have:
mysql_query (INSERT INTO `items` (`item_did_sell`, `sold_for`, `bought_by_paddle`) SELECT ('1','{$sold_for}','{$paddle_number}') FROM `items` WHERE index_number={$index_number}) or
I'm getting a strange error when assigning a value to one of my objects.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.