
[dbo].[usm_vw_subscription_times]
create view usm_vw_subscription_times as
select
cast(id as varchar) as id_char,
id,
account_no,
account_label,
parent_domain,
offering_id,
rate_plan_id,
item_id,
status,
subscription_type,
instance_name,
subscribed_date,
unsubscribed_date,
charge_date,
last_charge_date,
code,
charge,
installments,
tiered_item_id,
tiered_last_date,
text_1,
text_2,
text_3,
text_4,
text_5,
text_6,
text_7,
enum_1,
enum_2,
enum_3,
enum_4,
enum_5,
numeric_1,
numeric_2,
cast(request_id as varchar) as request_id_char,
request_id,
request_type,
domain,
group_id,
sd_row,
dbo.usm_fn_get_request_holdtime(request_id,id,'Approval Done') as hold_approval_seconds,
dbo.usm_fn_get_request_holdtime(request_id,id,'Fulfilled') as hold_fulfilled_seconds,
dbo.usm_fn_get_request_holdtime(request_id,id,'Completed') as hold_completed_seconds
from usm_subscription_detail
GO
GRANT SELECT ON [dbo].[usm_vw_subscription_times] TO [usmgroup]
GO