let g:dbext_default_SQLSRV_bin = 'sqlcmd'
let g:dbext_default_SQLSRV_cmd_options = ''
let g:dbext_default_profile_uca_dw = 'type=SQLSRV:srvname=167.3.129.85:dbname=UCA_DW:user=fgz:passwd=123456'
--dbext:profile=uca_dw
select p1.program,
p2.program,
p2.sub_module
from program p1, program p2
where p1.description = p2.description
and p1.sub_module = 'UNCLASSIFIED'
and p2.sub_module <> 'UNCLASSIFIED'
go
update p1
set p1.sub_module = p2.sub_module
from program p1, program p2
where p1.description = p2.description
and p1.sub_module = 'UNCLASSIFIED'
and p2.sub_module <> 'UNCLASSIFIED'
go
select eu_num,
name
from customer
where exists(select 1 from audit where audit.eu_num = customer.eu_num)
go
select a1.tot as "IDS Total Usage",
a2.tot as "Lang_mekra Total Usage",
a3.tot as "IDS Named User Usage",
a4.tot as "Lang_mekra Named User Usage"
from (select count(*) tot,
1 link
from app_usage t1, audit t2
where t1.audit_id = t2.audit_id
and t2.eu_num = '00048236'
) a1,
(select count(*) tot,
1 link
from app_usage t1, audit t2
where t1.audit_id = t2.audit_id
and t2.eu_num = '00061737'
) a2,
(select count distinct user_login tot,
1 link
from app_usage t1, audit t2
where t1.audit_id = t2.audit_id
and t2.eu_num = '00048236'
) a3,
(select count distinct user_login tot,
1 link
from app_usage t1, audit t2
where t1.audit_id = t2.audit_id
and t2.eu_num = '00061737'
) a4
where a1.link = a2.link
and a2.link = a3.link
and a3.link = a4.link
go