查询所有转换:
---只是转换
select a.ID_TRANSFORMATION 转换ID--,a.ID_DIRECTORY
,a.NAME 转换名称 --,b.ID_TRANS_HOP,b.ID_STEP_FROM,b.ID_STEP_TO
,DIRECTORY.DIRECTORY_NAME 目录名称
,c.name 表输入名称
,d.value_str 表输入脚本
,c1.name 表输出
,d1.value_str 输出表
from r_transformation A
left join r_trans_hop b on a.ID_TRANSFORMATION=b.id_transformation and b.ENABLED='1'
left join r_step c on c.id_step=b.id_step_from
left join r_step c1 on c1.id_step=b.id_step_to
--输入对应脚本
left join r_step_attribute d on d.id_step=b.id_step_from and d.code='sql'
--输出表
left join r_step_attribute d1 on d1.id_step=b.id_step_to and d1.code='table'
--目录
LEFT JOIN R_DIRECTORY DIRECTORY ON DIRECTORY.ID_DIRECTORY=A.ID_DIRECTORY
order by a.ID_TRANSFORMATION
结果:其中CLOB字段的值直接导出是可以在导出的EXCLE里面全显示的。如果需要工具中就展示需要用函数DBMS_LOB.SUBSTR()进行分割展示。
查询所有JOB:
---只是第一层JOB
select t.*
from(
select job.ID_JOB,JOB.NAME 作业名,DIRECTORY.DIRECTORY_NAME 目录,HOP.ID_JOBENTRY_COPY_FROM,hop.id_jobentry_copy_to
,case when HOP.Evaluation ='1' then '正确时走向' when HOP.Evaluation ='0' then '错误时走向' end 连接线走向
,JOBENTRY1.Name 连接线前作业名 ,JOBENTRY2.Name 连接线后作业名, HOP.ENABLED
from R_JOB JOB
LEFT JOIN R_DIRECTORY DIRECTORY ON DIRECTORY.ID_DIRECTORY=JOB.ID_DIRECTORY
LEFT JOIN R_JOB_HOP HOP ON HOP.ID_JOB=JOB.ID_JOB --AND HOP.ENABLED=1--是否有效
LEFT JOIN R_JOBENTRY_COPY COPY1 ON COPY1.ID_JOBENTRY_COPY=HOP.ID_JOBENTRY_COPY_FROM AND COPY1.ID_JOB=JOB.ID_JOB ----连接线FROM
LEFT JOIN R_JOBENTRY_COPY COPY2 ON COPY2.ID_JOBENTRY_COPY=HOP.ID_JOBENTRY_COPY_TO AND COPY2.ID_JOB=JOB.ID_JOB ----连接线to
left join R_JOBENTRY JOBENTRY1 on JOBENTRY1.ID_JOB=JOB.ID_JOB and JOBENTRY1.ID_JOBENTRY=COPY1.ID_JOBENTRY
left join R_JOBENTRY JOBENTRY2 on JOBENTRY2.ID_JOB=JOB.ID_JOB and JOBENTRY2.ID_JOBENTRY=COPY2.ID_JOBENTRY
--where job.ID_JOB in('9')
)t
order by t.ID_JOBENTRY_COPY_FROM desc
结果:
上述脚本只能查询出所有的JOB但是并不能区分出哪些是JOB中又有JOB ,因为会存在JOB名称跟TRANS名称相同的情况
R_JOB_HOP表结构:
id_job_hop integer 连接线id id_job integer 所属JOB id_jobentry_copy_from integer 连接线前端ID id_jobentry_copy_to integer 连接线后端ID enabled char(1) 连接线是否有效(1:有效;0:置灰无效) evaluation char(1) 连接线的走向(1:正确走向;0:错误走向) unconditional char(1)