title: if inside concat
body: <p>Here's the code I'm trying to use to create a trigger:</p>
  
  <pre><code>-- Dumping structure for trigger kavanga_lead.click_links_insert
  DROP TRIGGER IF EXISTS `click_links_insert`;
  SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='';
  DELIMITER //
  CREATE TRIGGER `click_links_insert` AFTER INSERT ON `click_links` FOR EACH ROW BEGIN
      INSERT INTO actions_log 
          (
              `uid`,
              `table`,
              `action`,
              `new`
          )
          VALUES
          (  
              @user_id,
              'click_links',
              'insert',
              concat(NEW.id ,'|', NEW.`contents`, '|', NEW.channel_id, '|', NEW.name, '|', NEW.hidden, '|', if(NEW.prefix_id is null,'',NEW.prefix_id) '|', if(NEW.postfix_id is null,'',NEW.postfix_id))
          );
  END//
  DELIMITER ;
  SET SQL_MODE=@OLD_SQL_MODE;
  </code></pre>
  
  <p>I keep getting an error (1583) <code>Incorrect parameters in the call to concat</code>.
  It works well if I don't use <code>if(NEW.prefix_id is null,'',NEW.prefix_id)</code> but just a <code>NEW.prefix_id</code>. But this field can be <code>null</code>, so all <code>concat</code>'s result becomes <code>null</code> to.</p>
  
  <p>So, the question is how can I use <code>IF</code> staments inside <code>CONCAT</code> call?</p>