Steffi1013
MIS
I am attempting to modify someone else's code and I need to do the following...
If employee id is 611481, then use the EmpName field in ReportMenu for the employee name, not the LAST_NAME, FIRST_NAME fields in the EMPLOYEE table.
The code that already exists is:
String sQuery = "";
try {
stmt = cx.createStatement();
sQuery = " SELECT WEB_USER, EMPLOYEE, COMPANY, EmpName";
sQuery += ", ID_TYPE, 'MVTPROD9', USR_EMAIL";
sQuery += ", Replevel, Division";
sQuery += " FROM ReportMenu";
if (!pUser.getLogin().equals("")) {
sQuery += " WHERE LOWER(RTRIM(WEB_USER)) " + DBUtils.getSqlString(pUser.getLogin().toLowerCase(),true,true);
} else if ((pUser.getCompany() > -1) && (pUser.getObjectId() > -1)) {
sQuery += " WHERE EMPLOYEE = " + pUser.getObjectId();
sQuery += " AND COMPANY = " + pUser.getCompany();
} else {
sQuery += " WHERE EMPLOYEE = " + pUser.getObjectId();
}
PLEASE help with if statement!
If employee id is 611481, then use the EmpName field in ReportMenu for the employee name, not the LAST_NAME, FIRST_NAME fields in the EMPLOYEE table.
The code that already exists is:
String sQuery = "";
try {
stmt = cx.createStatement();
sQuery = " SELECT WEB_USER, EMPLOYEE, COMPANY, EmpName";
sQuery += ", ID_TYPE, 'MVTPROD9', USR_EMAIL";
sQuery += ", Replevel, Division";
sQuery += " FROM ReportMenu";
if (!pUser.getLogin().equals("")) {
sQuery += " WHERE LOWER(RTRIM(WEB_USER)) " + DBUtils.getSqlString(pUser.getLogin().toLowerCase(),true,true);
} else if ((pUser.getCompany() > -1) && (pUser.getObjectId() > -1)) {
sQuery += " WHERE EMPLOYEE = " + pUser.getObjectId();
sQuery += " AND COMPANY = " + pUser.getCompany();
} else {
sQuery += " WHERE EMPLOYEE = " + pUser.getObjectId();
}
PLEASE help with if statement!