Default Column value in case of null
876673Oct 18 2011 — edited Oct 18 2011Hi friends,
I am new to dimensional query and need help to set the default value for columns. The query is mentioned below. I need to include the default values when the data for the column is null. How to implement this?
Query:
SELECT distinct s_id,SName, ENV_TYPE, h_id
FROM (
select s_id,s_code,s_value from table
where s_id = 6070
)
MODEL
IGNORE NAV
PARTITION BY
(s_id)
DIMENSION BY
(s_code)
MEASURES
(s_value,CAST( '' AS VARCHAR2(256) ) AS SName, CAST( '' AS VARCHAR2(256) ) AS ENV_TYPE, 0 AS h_id )
RULES UPDATE
(
SName[ANY] = service_value['SName'],
ENV_TYPE[ANY] = s_value['ENV_TYPE'],
h_id[ANY] = s_value['h_id']
Output:
S_id SName ENV_TYPE h_id
6070 null null null