-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swap our DSPFD
for object_statistics
#1992
Comments
We can also replace |
I think you mean select from |
I think it's actually |
@sebjulliand |
I just remembered that |
We need:
|
Ugh, my bad, |
-- only source
select
t.SYSTEM_TABLE_NAME as name,
'*FILE' as type,
'' as attribute,
t.table_text as text,
1 as is_source,
-1 as nb_mbr, -- no idea how to get this
c.character_maximum_length as SOURCE_LENGTH,
c.ccsid
from qsys2.systables as t
right join qsys2.syscolumns2 as c on t.system_table_schema = c.system_table_schema and t.SYSTEM_TABLE_NAME = c.SYSTEM_TABLE_NAME and c.column_name = 'SRCDTA'
where t.table_schema = 'LIAMA' and t.file_type = 'S';
-- all objects
select
o.objlib as LIBRARY,
o.objname as NAME,
o.objtype as TYPE,
o.objattribute as ATTRIBUTE,
o.objtext as TEXT,
0 as NB_MBR,
0 as IS_SOURCE,
0 as SOURCE_LENGTH,
65535 as CCSID,
o.objsize as SIZE,
o.objcreated as CREATED_TS,
o.objowner as OWNER,
o.objdefiner as CREATED_BY,
o.objsize as SIZE_IN_UNITS,
0 as BYTES_PER_UNIT
from table(qsys2.object_statistics('LIAMA', '*ALL')) as o;
-- get all objects and figure out which files are source files
select
o.objlib as LIBRARY,
o.objname as NAME,
o.objtype as TYPE,
o.objattribute as ATTRIBUTE,
o.objtext as TEXT,
-1 as NB_MBR,
case when c.character_maximum_length is null then 0 else 1 end as IS_SOURCE,
c.character_maximum_length as SOURCE_LENGTH,
c.ccsid as CCSID,
o.objsize as SIZE,
o.objcreated as CREATED_TS,
o.objowner as OWNER,
o.objdefiner as CREATED_BY,
o.objsize as SIZE_IN_UNITS,
0 as BYTES_PER_UNIT
from table(qsys2.object_statistics('LIAMA', '*ALL')) as o
left outer join qsys2.syscolumns2 as c on o.objlib = c.system_table_schema and o.objname = c.SYSTEM_TABLE_NAME and c.column_name = 'SRCDTA'
|
@worksofliam @sebjulliand
M - used by Merlin RPGLE LSP |
As we found in this comment, we are having issues with
DSPFD
when it comes to multiple encodings and a bad QCCSID. This is solved by usingobject_statistics
.Right now, this logic only has to be changed here:
vscode-ibmi/src/api/IBMiContent.ts
Line 505 in 8239670
The text was updated successfully, but these errors were encountered: