Return-Path: X-Original-To: apmail-manifoldcf-dev-archive@www.apache.org Delivered-To: apmail-manifoldcf-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 50C35174DD for ; Thu, 23 Oct 2014 07:48:34 +0000 (UTC) Received: (qmail 86144 invoked by uid 500); 23 Oct 2014 07:48:34 -0000 Delivered-To: apmail-manifoldcf-dev-archive@manifoldcf.apache.org Received: (qmail 86091 invoked by uid 500); 23 Oct 2014 07:48:34 -0000 Mailing-List: contact dev-help@manifoldcf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@manifoldcf.apache.org Delivered-To: mailing list dev@manifoldcf.apache.org Received: (qmail 86079 invoked by uid 99); 23 Oct 2014 07:48:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Oct 2014 07:48:34 +0000 Date: Thu, 23 Oct 2014 07:48:34 +0000 (UTC) From: "Karl Wright (JIRA)" To: dev@manifoldcf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CONNECTORS-1078) Update documentation regarding JDBC, MySQL and CONCAT MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CONNECTORS-1078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Karl Wright resolved CONNECTORS-1078. ------------------------------------- Resolution: Fixed > Update documentation regarding JDBC, MySQL and CONCAT > ----------------------------------------------------- > > Key: CONNECTORS-1078 > URL: https://issues.apache.org/jira/browse/CONNECTORS-1078 > Project: ManifoldCF > Issue Type: Improvement > Components: Documentation > Reporter: Jens Jahnke > Assignee: Karl Wright > Priority: Minor > Labels: concat, jdbc, mysql > Fix For: ManifoldCF 1.8, ManifoldCF 2.0 > > > A little late but here is my solution to the mysql concat problem from the mailing list for the documentation. ;-) > When using the generic database connector with a mysql connection you have to be aware of the behaviour of the {{concat}} command if you combine multiple columns. > For example the following query will not work if any value is {{NULL}}: > {code:sql} > SELECT id AS $(IDCOLUMN), > CONCAT("http://my.base.url/show.html?record=", id) AS $(URLCOLUMN), > CONCAT(name, " ", description, " ", what_ever) AS $(DATACOLUMN) > FROM accounts WHERE id IN $(IDLIST) > {code} > You'll have to use the {{ifnull}} operator to circumvent the issue. > {code:sql} > SELECT id AS $(IDCOLUMN), > CONCAT("http://my.base.url/show.html?record=", id) AS $(URLCOLUMN), > CONCAT(name, " ", IFNULL(description, ""), " ", IFNULL(what_ever, "")) > AS $(DATACOLUMN) > FROM accounts WHERE id IN $(IDLIST) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)