SELECT A.fieldname , 1 FROM PSDBFIELD A WHERE A.fieldname IN ( 'LM_ACT_OWNER_ID', 'LM_APPR_ID','LM_ASSIGNED_BY', 'LM_CNTCT_ID', 'LM_COORD_ID', 'LM_ENRLMT_ADMIN_ID', 'LM_EXT_APPR_ID', 'LM_INSTR_ID', 'LM_INT_APPR_ID', 'LM_LPLN_CREATED_BY', 'LM_MANAGER_ID', 'LM_OWNER_ID', 'LM_PRVD_ID', 'LM_REQUESTOR_ID', 'LM_SHPMNT_OWNR_ID', 'LM_SPL_APPROVER' , 'LM_SRC_PERSON_ID', 'LM_SUPERVISOR_ID', 'LM_TARGT_PERSON_ID' ) AND EXISTS ( SELECT 'X' FROM PSDBFIELD b WHERE b.fieldname = 'LM_PERSON_ID' AND b.fieldtype = a.fieldtype AND b.length = a.length AND b.decimalpos = a.decimalpos) UNION SELECT A.fieldname , 2 FROM PSDBFIELD A WHERE A.fieldname = 'LM_PERSON_ID'
|