rbrooker
Member³
Code:
PROCEDURE ext_employee IS
v_sql VARCHAR2(4000);
BEGIN
v_sql := q'[SELECT a.emp_olacsid || ',' || --
a.emp_employeenumber || ',' || --
decode(a.emp_preferredname, ' ', a.emp_firstname, a.emp_preferredname) || ',' || --
a.emp_surname || ',' || --
a.emp_emailaddress data
FROM thub_employee a
WHERE a.emp_type NOT IN ('Pre Go-Live (Jun08)', 'External Contractors')
UNION
SELECT a.emp_olacsid || ',' || --
a.emp_employeenumber || ',' || --
decode(a.emp_preferredname, ' ', a.emp_firstname, a.emp_preferredname) || ',' || --
a.emp_surname || ',' || --
a.emp_emailaddress data
FROM thub_employee a
WHERE emp_employeenumber IN (SELECT pos_substantivemanager
FROM thub_employee
WHERE emp_type NOT IN ('External Contractors', 'Pre Go-Live (Jun08)')
AND pos_substantivemanager != 0)]';
ext_writefile(v_sql, 'tia_employee.csv');
END;
Note that the beautifier changes ?string context? when it hits a )' character combination. I am excluding people based on the employee type, one of the types is "Pre Go-Live (Jun08)". therefore, I cannot get around the use of )'. Can the beautifier be fixed please?
Keep up the good work.
rich.