I don't use TOAD, but i do some Oracle conversions a lot.
i thought ALL concatenation in Oracle must use double pipes...why do i see you trying to + strings togehter? is that a toad functionality?
should it be more like this?
string str3 = " SELECT a.siebleloginid, a.employee, MAX (a.tierlevel) AS tier FROM "
|| " ((SELECT e.siebleloginid, e.lastname || ', ' || e.firstname AS employee, "
|| " DECODE (e.siebleloginid, m.siebleloginid, 2, DECODE (e.username, z.usernamesup, 1, 0) ) "
|| " AS tierlevel FROM emadministration.tblemployeeinfo m, emadministration.tblemployeeinfo e, "
|| " emadministration.tblzlistsectsup z WHERE m.siebleloginid ='OLEMSUP' AND "
|| " z.usernameman = m.username AND e.section = z.section AND e.employmentstatus = 'Active') "
|| " UNION (SELECT e.siebleloginid, e.lastname || ', ' || e.firstname AS employee, "
|| " DECODE (e.siebleloginid, m.siebleloginid, 1, 0 ) AS tierlevel FROM "
|| " emadministration.tblemployeeinfo m, emadministration.tblemployeeinfo e, "
|| " emadministration.tblzlistsectsup z WHERE m.siebleloginid ='OLEMSUP' "
|| " AND (z.usernamesup = m.username OR (z.usernametempsup = m.username "
|| " AND z.tempsupenddate >= TRUNC (SYSDATE - 0.25))) "
|| " AND e.section = z.section AND e.employmentstatus = 'Active') "
|| " UNION (SELECT e.siebleloginid, e.lastname || ', ' || e.firstname AS employee, "
|| " DECODE (zm.usernameman, NULL, DECODE (zs.usernamesup, NULL, 0, 1),2) AS tierlevel "
|| " FROM emadministration.tblemployeeinfo e, emadministration.tblzlistsectsup zm, "
|| " emadministration.tblzlistsectsup zs WHERE e.siebleloginid ='OLEMSUP' AND "
|| " e.employmentstatus = 'Active'AND e.username = zm.usernameman(+) AND "
|| " e.username = zs.usernamesup(+))) a GROUP BY a.siebleloginid, a.employee "
|| " ORDER BY tier DESC, employee " ;
Lowell