来自IFS的System i SQL流文件



IBM System i V7R3M0我想用SQL提取一个.json文件。SQL无法解析QSYS2.IFS_READ.

select x.id, x.username, x.firstName, x.lastName, x.email 
from json_table(
QSYS2.IFS_READ(PATH_NAME => '/FileTransferData/userList.json'), 
'lax $' columns (
id INTEGER PATH 'lax $.id',
username VARCHAR(30) FORMAT JSON PATH 'lax $.username',
firstName VARCHAR(30) FORMAT JSON PATH 'lax $.firstName',
lastName VARCHAR(30) FORMAT JSON PATH 'lax $.lastName',
email VARCHAR(75) FORMAT JSON PATH 'lax $.email'
)
)
as x;

错误为:

SQL State: 42704
Vendor Code: -204
Message: [SQL0204] IFS_READ in QSYS2 type *N not found. Cause . . . . . :   IFS_READ in QSYS2 type *N was not found. 

QZDASOINT中的作业日志告诉我同样的事情,即我在QSYS2 中没有IFS_READ

Job 111566/QUSER/QZDASOINIT started on 04/12/21 at 12:23:06 in subsystem QUSRWRK in QSYS. Job entered system on 04/12/21 at 12:23:06.
User MOLNARJ from client 10.111.0.24 connected to server.
The following special registers have been set: CLIENT_ACCTNG: ,
CLIENT_APPLNAME: System i Navigator - Run SQL Scripts, CLIENT_PROGRAMID:
cwbunnav.exe, CLIENT_USERID: MOLNARJ, CLIENT_WRKSTNNAME:
FS2ISYMOB943.umassmemorial.org
Trigger Q__OSYS_QAQQINI_BEFORE_INSERT_______ in library QTEMP was added to file QAQQINI in library QTEMP.
Trigger Q__OSYS_QAQQINI_AFTER_INSERT________ in library QTEMP was added to file QAQQINI in library QTEMP.
Trigger Q__OSYS_QAQQINI_BEFORE_UPDATE_______ in library QTEMP was added to file QAQQINI in library QTEMP.
Trigger Q__OSYS_QAQQINI_AFTER_UPDATE________ in library QTEMP was added to  file QAQQINI in library QTEMP.
Trigger Q__OSYS_QAQQINI_BEFORE_DELETE_______ in library QTEMP was added to
file QAQQINI in library QTEMP.
Trigger Q__OSYS_QAQQINI_AFTER_DELETE________ in library QTEMP was added to file QAQQINI in library QTEMP.
Object QAQQINI in QTEMP type *FILE created.
1 objects duplicated.
IFS_READ in QSYS2 type *N not found.

我处于进退两难的境地。我的外包支持公司声称我需要创建一个程序来使用API。但是,我相信API没有安装。

我的工作基于IBM的技术文档,例如:https://www.ibm.com/docs/en/i/7.4?topic=is-ifs-read-ifs-read-binary-ifs-red-utf8-table-functions

运行此文档中的示例(将文件路径和名称更改为我的(会出现同样的错误。

SELECT * FROM TABLE(QSYS2.IFS_READ(PATH_NAME => '/FileTransferData/userList.json', END_OF_LINE => 'CRLF'));

此链接表示需要PTF SF99703级别22。您可以使用检查已安装或可用的内容

with iLevel(iVersion, iRelease) as (
select
OS_VERSION, OS_RELEASE
from
sysibmadm.env_sys_info )
select
case PTF_GROUP_CURRENCY when 'INSTALLED LEVEL IS CURRENT' then '' else PTF_GROUP_CURRENCY end,
PTF_GROUP_ID "ID",
PTF_GROUP_TITLE "Title",
PTF_GROUP_LEVEL_INSTALLED "Installed",
PTF_GROUP_LEVEL_AVAILABLE "Available",
ptf_group_level_available - ptf_group_level_installed "Diff",
date(to_date(PTF_GROUP_LAST_UPDATED_BY_IBM, 'MM/DD/YYYY')) "Available since",
current date - date(to_date(PTF_GROUP_LAST_UPDATED_BY_IBM, 'MM/DD/YYYY')) "Days since available",
PTF_GROUP_RELEASE "Release",
PTF_GROUP_STATUS_ON_SYSTEM "Status"
from
iLevel,
systools.group_ptf_currency P
where
ptf_group_id = 'SF99703'
order by
ptf_group_level_available - ptf_group_level_installed desc;

相关内容

  • 没有找到相关文章

最新更新