IDEMPIERE-1875 Bad SQL produces ORA-Error

This commit is contained in:
Dirk Niemeyer 2014-04-03 16:44:10 -05:00
parent 170afa6e09
commit 93bc5f0909
2 changed files with 5 additions and 4 deletions

View File

@ -108,8 +108,8 @@ public class CopyRole extends SvrProcess
sql.append(") "); sql.append(") ");
sql.append("SELECT ").append(m_AD_Client_ID) sql.append("SELECT ").append(m_AD_Client_ID)
.append(", ").append(m_AD_Org_ID) .append(", ").append(m_AD_Org_ID)
.append(", getdate(), ").append(Env.getAD_User_ID(Env.getCtx())) .append(", SYSDATE, ").append(Env.getAD_User_ID(Env.getCtx()))
.append(", getdate(), ").append(Env.getAD_User_ID(Env.getCtx())) .append(", SYSDATE, ").append(Env.getAD_User_ID(Env.getCtx()))
.append(", ").append(m_AD_Role_ID_To) .append(", ").append(m_AD_Role_ID_To)
.append(", ").append(keycolumn) .append(", ").append(keycolumn)
.append(", IsActive "); .append(", IsActive ");

View File

@ -2778,9 +2778,10 @@ public final class MRole extends X_AD_Role
+" SELECT 1 FROM AD_User_Roles ur" +" SELECT 1 FROM AD_User_Roles ur"
+" INNER JOIN AD_User_Substitute us ON (us.AD_User_ID=ur.AD_User_ID)" +" INNER JOIN AD_User_Substitute us ON (us.AD_User_ID=ur.AD_User_ID)"
+" WHERE ur.AD_Role_ID=AD_Role.AD_Role_ID AND ur.IsActive='Y' AND us.IsActive='Y'" +" WHERE ur.AD_Role_ID=AD_Role.AD_Role_ID AND ur.IsActive='Y' AND us.IsActive='Y'"
+" AND (us.ValidFrom IS NULL OR us.ValidFrom <= getdate())" +" AND (us.ValidFrom IS NULL OR us.ValidFrom <= SYSDATE)"
+" AND (us.ValidTo IS NULL OR us.ValidTo >= getdate())" +" AND (us.ValidTo IS NULL OR us.ValidTo >= SYSDATE)"
+" AND us.Substitute_ID=?)"; +" AND us.Substitute_ID=?)";
List<MRole> list = new Query(getCtx(), Table_Name, whereClause, get_TrxName()) List<MRole> list = new Query(getCtx(), Table_Name, whereClause, get_TrxName())
.setParameters(new Object[]{AD_User_ID}) .setParameters(new Object[]{AD_User_ID})
.setClient_ID() .setClient_ID()