Free Form Text Block in Code Editor
Posted: Tue Oct 01, 2019 12:09 am
Do the developers still pay attention to this board? The board description mentions that all entries will acknowledged, but a lot of these go unacknowledged.
In case they do, it would be nice to have a free format text block in the IDE editor.
The editor is VERY demanding with its spacing and indention which makes dealing with large complex string (like when using select_sql) very difficult.
For example take this query that unions data from two different (but structurally same) libraries:
This is a very complex query that pivots on months. The query is difficult enough to handle in normal SQL tools, and near impossible to deal with in the editor.
What I would like to see is a text block capability so that query could be formatted into a more manageable form.
For example:
Notice the leading and trailing backtick (`). This is how a lot of other editors support this type of functionality and I think it would make the VL IDE much easier to use in these cases.
It could be argued that this particular query should be turned into a View, but for reasons beyond this discussion it cannot, and merely serves as an example of complex strings in the IDE.
Thoughts?
Joe
In case they do, it would be nice to have a free format text block in the IDE editor.
The editor is VERY demanding with its spacing and indention which makes dealing with large complex string (like when using select_sql) very difficult.
For example take this query that unions data from two different (but structurally same) libraries:
Code: Select all
#lSql := ("select BDBC, BDFTYP, BDFR, case when Month = 1 then sum(GM) end as JAN, case when Month = 2 then sum(GM) end as FEB, case when Month = 3 then sum(GM) end as MAR, case when Month = 4 then sum(GM) end as APR, case when Month = 5 then sum(GM) end as MAY, case when Month = 6 then sum(GM) end as JUN, case when Month = 7 then sum(GM) end as JUL, case when Month = 8 then sum(GM) end as AUG, case when Month = 9 then sum(GM) end as SEP, case when Month = 10 then sum(GM) end as OCT, case when Month = 11 then sum(GM) end as NOV, case when Month = 12 then sum(GM) end as DEC from ( select BDBC, BDFTYP, BDFR, month(date(timestamp_format(char(BDDWP),'YYYYMMDD'))) as Month, sum(BDGMA) as GM from &1.AF1220 where BDOFID in (select OFID from &1.XF1102E where ELVL = 0 and ZONE = &3) and BDELVL = 0 and BDDWP > &4 and BDDWP <= &5 group by BDBC, BDFTYP, BDFR, month(date(timestamp_format(char(BDDWP),'YYYYMMDD'))) union all select BDBC, BDFTYP, BDFR, month(date(timestamp_format(char(BDDWP),'YYYYMMDD'))) as Month, sum(BDGMA) as GM from &1.AF1220 where BDOFID in (select OFID from &2.XF1102E where ELVL = 0 and ZONE = &3) and BDELVL = 0 and BDDWP > &4 and BDDWP <= &5 group by BDBC, BDFTYP, BDFR, month(date(timestamp_format(char(BDDWP),'YYYYMMDD')))) a group by BDBC, BDFTYP, BDFR, Month order by BDBC, BDFTYP, BDFR").Substitute( #lUSDataLibrary #lCADataLibrary #wk_Zone.AsString #wk_StartDate.AsString #wk_EndDate.AsString )
What I would like to see is a text block capability so that query could be formatted into a more manageable form.
For example:
Code: Select all
#lSql :=( `
select BDBC, BDFTYP, BDFR,
case when Month = 1 then sum(GM) end as JAN,
case when Month = 2 then sum(GM) end as FEB,
case when Month = 3 then sum(GM) end as MAR,
case when Month = 4 then sum(GM) end as APR,
case when Month = 5 then sum(GM) end as MAY,
case when Month = 6 then sum(GM) end as JUN,
case when Month = 7 then sum(GM) end as JUL,
case when Month = 8 then sum(GM) end as AUG,
case when Month = 9 then sum(GM) end as SEP,
case when Month = 10 then sum(GM) end as OCT,
case when Month = 11 then sum(GM) end as NOV,
case when Month = 12 then sum(GM) end as DEC
from (
select BDBC,
BDFTYP,
BDFR,
month(date(timestamp_format(char(BDDWP),'YYYYMMDD'))) as Month,
sum(BDGMA) as GM
from &1.AF1220
where BDOFID in (select OFID from &1.XF1102E where ELVL = 0 and ZONE = &3)
and BDELVL = 0
and BDDWP > &4
and BDDWP <= &5
group by BDBC, BDFTYP, BDFR, month(date(timestamp_format(char(BDDWP),'YYYYMMDD')))
union all
select BDBC,
BDFTYP,
BDFR,
month(date(timestamp_format(char(BDDWP),'YYYYMMDD'))) as Month,
sum(BDGMA) as GM
from &1.AF1220
where BDOFID in (select OFID from &2.XF1102E where ELVL = 0 and ZONE = &3)
and BDELVL = 0
and BDDWP > &4
and BDDWP <= &5
group by BDBC, BDFTYP, BDFR, month(date(timestamp_format(char(BDDWP),'YYYYMMDD')))
) a
group by BDBC, BDFTYP, BDFR, Month
order by BDBC, BDFTYP, BDF
`).Substitute( #lUSDataLibrary #lCADataLibrary #wk_Zone.AsString #wk_StartDate.AsString #wk_EndDate.AsString )
It could be argued that this particular query should be turned into a View, but for reasons beyond this discussion it cannot, and merely serves as an example of complex strings in the IDE.
Thoughts?
Joe