Hi,
I have created a Oracle view with nested select, Can you please tell me how I can map this column ? I wanted to know how I can mal iface_ids and iface_names columns, which will have a collection.
Code:
DROP VIEW HHMEFEP.QOS_PATH_VIEW_GUI;
/* Formatted on 2009/07/13 09:08 (Formatter Plus v4.8.8) */
CREATE OR REPLACE FORCE VIEW hhmefep.qos_path_view_gui (ID,
NAME,
description,
nbr_qos_sessions,
nbr_bkgnd_sessions,
max_tx_bw,
max_rx_bw,
max_qos_tx_bw,
max_qos_rx_bw,
max_bkgnd_tx_bw,
max_bkgnd_rx_bw,
curr_qos_tx_bw,
curr_qos_rx_bw,
avail_qos_tx_bw,
avail_qos_rx_bw,
comments,
created_by,
created_on,
modified_by,
modified_on,
qos_cac_enabled,
admin_barred,
path_barred,
apn_id,
apn_name,
vpn_id,
vpn_name,
iface_ids,
iface_names,
alarm_thresh_enabled
)
AS
SELECT ID, NAME, description, nbr_qos_sessions, nbr_bkgnd_sessions,
max_tx_bw, max_rx_bw, max_qos_tx_bw, max_qos_rx_bw,
max_bkgnd_tx_bw, max_bkgnd_rx_bw, curr_qos_tx_bw, curr_qos_rx_bw,
avail_qos_tx_bw, avail_qos_rx_bw, comments, created_by,
created_on, modified_by, modified_on, qos_cac_enabled,
admin_barred, path_barred, apn_id, apn_name, vpn_id, vpn_name,
COLLECT (iface_id),
--cast(collect(iface_id) as collect_table) ,
-- tab_to_string(cast(collect(iface_id) as t_nvarchar2_tab)),
COLLECT (iface_name),
-- tab_to_string(cast(collect(iface_name)as t_nvarchar2_tab)),
alarm_thresh_enabled
FROM (SELECT pl.ID AS ID, pl.NAME AS NAME,
p.description AS description,
pl.nbr_qos_sessions AS nbr_qos_sessions,
pl.nbr_bkgnd_sessions AS nbr_bkgnd_sessions,
pl.max_tx_bw AS max_tx_bw, pl.max_rx_bw AS max_rx_bw,
pl.max_qos_tx_bw AS max_qos_tx_bw,
pl.max_qos_rx_bw max_qos_rx_bw,
pl.max_bkgnd_tx_bw AS max_bkgnd_tx_bw,
pl.max_bkgnd_rx_bw AS max_bkgnd_rx_bw,
pl.curr_qos_tx_bw AS curr_qos_tx_bw,
pl.curr_qos_rx_bw AS curr_qos_rx_bw,
ph.curr_qos_tx_head AS avail_qos_tx_bw,
ph.curr_qos_rx_head AS avail_qos_rx_bw,
p.comments AS comments,
rev_init.modified_by AS created_by,
rev_init.modified_on AS created_on,
rev_last.modified_by AS modified_by,
rev_last.modified_on AS modified_on,
p.qos_cac_enabled AS qos_cac_enabled,
p.admin_barred AS admin_barred,
p.path_barred AS path_barred, p.apn AS apn_id,
(SELECT NAME
FROM qos_iface
WHERE ID = p.apn) AS apn_name, p.vpn AS vpn_id,
(SELECT NAME
FROM qos_iface
WHERE ID = p.vpn) AS vpn_name, qpi.iface AS iface_id,
(SELECT NAME
FROM qos_iface
WHERE ID = qpi.iface) AS iface_name,
p.qos_alarm_thresh_enabled AS alarm_thresh_enabled
FROM qos_path_load pl INNER JOIN qos_path_head ph ON pl.ID =
ph.ID
INNER JOIN qos_path p ON pl.ID = p.ID
INNER JOIN qos_path_rev rev_init ON p.init_rev =
rev_init.ID
INNER JOIN qos_path_rev rev_last ON p.rev = rev_last.ID
INNER JOIN qos_path_iface qpi ON p.ID = qpi.PATH
)
GROUP BY ID,
NAME,
description,
nbr_qos_sessions,
nbr_bkgnd_sessions,
max_tx_bw,
max_rx_bw,
max_qos_tx_bw,
max_qos_rx_bw,
max_bkgnd_tx_bw,
max_bkgnd_rx_bw,
curr_qos_tx_bw,
curr_qos_rx_bw,
avail_qos_tx_bw,
avail_qos_rx_bw,
comments,
created_by,
created_on,
modified_by,
modified_on,
qos_cac_enabled,
admin_barred,
path_barred,
apn_id,
apn_name,
vpn_id,
vpn_name,
alarm_thresh_enabled;
Thanks
Gireesh