From 99d5a4a7b11db496d2ce423c5cc3a937b279f98b Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 23 Nov 2009 23:54:19 +0000 Subject: [PATCH] Fix a NPE problem found with [2877111] - See identifiers columns when delete records https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2877111&group_id=176962 oracle needs NVL instead of COALESCE - to avoid ORA-12704 character set mismatch --- base/src/org/compiere/model/MLookupFactory.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base/src/org/compiere/model/MLookupFactory.java b/base/src/org/compiere/model/MLookupFactory.java index a24bf99f8e..4706ef3a35 100644 --- a/base/src/org/compiere/model/MLookupFactory.java +++ b/base/src/org/compiere/model/MLookupFactory.java @@ -848,24 +848,24 @@ public class MLookupFactory // date, number else if (DisplayType.isDate(ldc.DisplayType) || DisplayType.isNumeric(ldc.DisplayType)) { - embedSQL.append("COALESCE(" + DB.TO_CHAR(TableName + "." + ldc.ColumnName, ldc.DisplayType, language.getAD_Language()) + ",'')"); + embedSQL.append("NVL(" + DB.TO_CHAR(TableName + "." + ldc.ColumnName, ldc.DisplayType, language.getAD_Language()) + ",'')"); } // TableDir else if ((ldc.DisplayType == DisplayType.TableDir || ldc.DisplayType == DisplayType.Search) && ldc.ColumnName.endsWith("_ID")) { String embeddedSQL = getLookup_TableDirEmbed(language, ldc.ColumnName, TableName); - embedSQL.append("COALESCE((").append(embeddedSQL).append("),'')"); + embedSQL.append("NVL((").append(embeddedSQL).append("),'')"); } // Table - teo_sarca [ 1714261 ] else if (ldc.DisplayType == DisplayType.Table && ldc.AD_Reference_ID != 0) { String embeddedSQL = getLookup_TableEmbed (language, ldc.ColumnName, TableName, ldc.AD_Reference_ID); - embedSQL.append("COALESCE((").append(embeddedSQL).append("),'')"); + embedSQL.append("NVL((").append(embeddedSQL).append("),'')"); } // String else - embedSQL.append("COALESCE(").append(TableName).append(".").append(ldc.ColumnName).append(",'')"); + embedSQL.append("NVL(").append(TableName).append(".").append(ldc.ColumnName).append(",'')"); } embedSQL.append(" FROM ").append(TableName);