开发过程中发现有一些特殊代码命名有要求
比如
代码:
select "project_id",
null LINK_CLASS,
apex_page.get_url(p_items => 'P201_PROJECT_ID', p_values => "project_id") LINK,
null ICON_CLASS,
null LINK_ATTR,
null ICON_COLOR_CLASS,
case when coalesce(:P201_PROJECT_ID,'0') = "project_id"
then 'is-active'
else ' '
end LIST_CLASS,
(substr("project_name", 1, 50)||( case when length("project_name") > 50 then '...' else '' end )) LIST_TITLE,
(substr("project_owner", 1, 50)||( case when length("project_owner") > 50 then '...' else '' end )) LIST_TEXT,
null LIST_BADGE
from "JAS_PROJECT_MASTER" x
where (:P201_SEARCH is null
or upper(x."project_name") like '%'||upper(:P201_SEARCH)||'%'
or upper(x."project_owner") like '%'||upper(:P201_SEARCH)||'%'
)
and to_char("start_date",'yyyy') = '2024'
--and to_char("start_date",'yyyy') = '2023' --写死的,显示查询数据
order by "project_name"
之前用的自己的代码在DataGrip中运行可以展示,但是因为没有用别名命名,APEX页面展示是乱码,后来用了对应别名才正常显示:
之前:
select D.PLATFORM_DEMAND_ID , --需求id
D.DEMAND_TITLE --需求名称
from DIGITAL_PLATFORM_DEMAND D
left join DIGITAL_PLATFORM_DEMAND_HIS H
on D.PLATFORM_DEMAND_ID = H.PLATFORM_DEMAND_ID
and D.TENANT_ID = H.TENANT_ID
and H.PLATFORM_DEMAND_HIS_ID =
(select MAX(e.PLATFORM_DEMAND_HIS_ID)
from DIGITAL_PLATFORM_DEMAND_HIS e
where e.PLATFORM_DEMAND_ID = D.PLATFORM_DEMAND_ID)
where (:P261_SEARCH is null
or upper(D.DEMAND_TITLE) like '%'||upper(:P261_SEARCH)||'%')
and to_char(D.CREATED_DATE, 'yyyy') = '2024'
之后:
select D.PLATFORM_DEMAND_ID LIST_TEXT, --需求id
D.DEMAND_TITLE LIST_TITLE --需求名称
from DIGITAL_PLATFORM_DEMAND D
left join DIGITAL_PLATFORM_DEMAND_HIS H
on D.PLATFORM_DEMAND_ID = H.PLATFORM_DEMAND_ID
and D.TENANT_ID = H.TENANT_ID
and H.PLATFORM_DEMAND_HIS_ID =
(select MAX(e.PLATFORM_DEMAND_HIS_ID)
from DIGITAL_PLATFORM_DEMAND_HIS e
where e.PLATFORM_DEMAND_ID = D.PLATFORM_DEMAND_ID)
where (:P261_SEARCH is null
or upper(D.DEMAND_TITLE) like '%'||upper(:P261_SEARCH)||'%')
and to_char(D.CREATED_DATE, 'yyyy') = '2024'
改动的点: