IDEMPIERE-4178 Add NVL PostgreSQL function

This commit is contained in:
Carlos Ruiz 2020-03-15 10:03:50 +01:00
parent 02647cc5ee
commit 4e6794b0a1
3 changed files with 4 additions and 4 deletions

View File

@ -658,8 +658,8 @@ public class ImportGLJournal extends SvrProcess
// Go through Journal Records
sql = new StringBuilder ("SELECT * FROM I_GLJournal ")
.append("WHERE I_IsImported='N'").append (clientCheck)
.append(" ORDER BY COALESCE(BatchDocumentNo, TO_NCHAR(I_GLJournal_ID)||' '), COALESCE(JournalDocumentNo, ")
.append("TO_NCHAR(I_GLJournal_ID)||' '), C_AcctSchema_ID, PostingType, C_DocType_ID, GL_Category_ID, ")
.append(" ORDER BY NVL(BatchDocumentNo, I_GLJournal_ID||' '), NVL(JournalDocumentNo, ")
.append("I_GLJournal_ID||' '), C_AcctSchema_ID, PostingType, C_DocType_ID, GL_Category_ID, ")
.append("C_Currency_ID, TRUNC(DateAcct), Line, I_GLJournal_ID");
try
{

View File

@ -237,7 +237,7 @@ public class MProjectType extends X_C_ProjectType
else
{
orderBy = "p.SeqNo";
groupBy = "COALESCE(p.Name,TO_NCHAR('-')), p.C_Phase_ID, p.SeqNo ";
groupBy = "NVL(p.Name,'-'), p.C_Phase_ID, p.SeqNo ";
sb.append(groupBy)
.append("FROM C_Project LEFT OUTER JOIN C_Phase p ON (C_Project.C_Phase_ID=p.C_Phase_ID) ");
}

View File

@ -426,7 +426,7 @@ public class MRequestType extends X_R_RequestType
else
{
orderBy = "s.SeqNo";
groupBy = "COALESCE(s.Name,TO_NCHAR('-')), s.R_Status_ID, s.SeqNo ";
groupBy = "NVL(s.Name,'-'), s.R_Status_ID, s.SeqNo ";
sb.append(groupBy)
.append("FROM R_Request LEFT OUTER JOIN R_Status s ON (R_Request.R_Status_ID=s.R_Status_ID) ");
}