На примере SEL_TS2_SectionDoc DelivShedTree
GETSQLTEXT
select
t.ID
, t.idRefClass , BTK_ClientGate.GetHeadLine(t.idRefClass) as idRefClass_HL
, t.sName
, t.sCaption
, t.dPlanDateProj
, t.nPlanWeeksProj
, t.idProjectType, TS2_SectionDocAPI.GetidProjectType_HL(t.idProjectType) as idProjectType_HL
, t.idProject, TS2_SectionDocAPI.GetidProject_HL(t.idProject) as idProject_HL
, t.idClass
from TS2_SectionDoc t
union all
select
cast(null as number) as ID
, cast(null as number) as idRefClass, cast(null as varchar2(50)) as idRefClass_HL
, 'Тестовая дока' as sName
, 'Test doc' as sCaption
, cast(null as date) as dPlanDateProj
, cast(null as number) as nPlanWeeksProj
, cast(null as number) as idProjectType, cast(null as varchar2(50)) as idProjectType_HL
, cast(null as number) as idProject, cast(null as varchar2(50)) as idProject_HL
, cast(null as number) as idClass
from dual