create or replace view cv_vallist_all as
select
S.BRN_ID,
S.CODE,
S.CONSTVAL,
S.GENMODE,
S.CONSTCODE,
substr (nvl(L.SHORTNAME,S.SHORTNAME), 1, 10) as SHORTNAME,
S.ARCFL,
substr (nvl(L.NAME,S.NAME), 1, 30) as NAME,
substr (nvl(L.PRIM,S.PRIM), 1, 250) as PRIM,
substr (nvl(L.LONGNAME,S.LONGNAME), 1, 250) as LONGNAME,
S.TXT_ADD
from C_VALLIST_LNG L,
C_VALLIST_STD S
where L.LNG_ID(+) = P_Lng
and L.BRN_ID(+) = S.BRN_ID
and L.CODE(+) = S.CODE
and L.CONSTVAL(+) = S.CONSTVAL;
comment on column CV_VALLIST_ALL.CODE is 'CODE';
comment on column CV_VALLIST_ALL.CONSTVAL is 'CONSTVAL';
comment on column CV_VALLIST_ALL.GENMODE is 'GENMODE';
comment on column CV_VALLIST_ALL.CONSTCODE is 'CONSTCODE';
comment on column CV_VALLIST_ALL.SHORTNAME is 'SHORTNAME';
comment on column CV_VALLIST_ALL.ARCFL is 'ARCFL';
comment on column CV_VALLIST_ALL.NAME is 'NAME';
comment on column CV_VALLIST_ALL.PRIM is 'PRIM';
comment on column CV_VALLIST_ALL.LONGNAME is 'LONGNAME';
comment on column CV_VALLIST_ALL.TXT_ADD is 'TXT_ADD';
insert into CV_VALLIST_ALL
(CODE, CONSTVAL, BRN_ID, GENMODE, CONSTCODE, SHORTNAME, ARCFL, NAME, PRIM, LONGNAME, TXT_ADD)
values
('N_FRM_REF', 't', 21, 'n', '', 'T', 0, 't', '', 't', '')