× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Yeap Tim, looking at my code

exec sql set :query = systools.urldecode(:query,'UTF-8');

turned on the JVM.



On 2/27/20, 8:23 AM, "WEB400 on behalf of Tim Fathers" <web400-bounces@xxxxxxxxxxxxxxxxxx on behalf of X700-IX2J@xxxxxxxxxxx> wrote:


>The sql JSON is Java based and I have find more issues with java on the iseries...

Not as far as I know it isn't (and I see no evidence of the JVM being invoked when the JSON functions are used). I think you maybe thinking of the HTTP functions, which do use the JVM.

Tim.




________________________________
From: WEB400 <web400-bounces@xxxxxxxxxxxxxxxxxx> on behalf of Slanina, John via WEB400 <web400@xxxxxxxxxxxxxxxxxx>
Sent: 27 February 2020 14:11
To: Web Enabling the IBM i (AS/400 and iSeries) <WEB400@xxxxxxxxxxxxxxxxxx>
Cc: Slanina, John <jslanina@xxxxxxxxxx>
Subject: Re: [WEB400] JSON

Esteban,

Try docNode = yajl_buf_load_tree(%addr(RdiRec) : RdiRecLen : errMsg); from YAJL

I use in in 100's of programs.

The sql JSON is Java based and I have find more issues with java on the iseries then Scotts programs.
also Scott give better support.. __


Thanks
John Slanina


On 2/27/20, 7:21 AM, "WEB400 on behalf of Tim Fathers" <web400-bounces@xxxxxxxxxxxxxxxxxx on behalf of X700-IX2J@xxxxxxxxxxx> wrote:

I'm assuming by "parse" you mean "construct" right? In any case why bother with a third party library, why not just use SQL?

For single values just use:
exec sql set :myField = coalesce(json_value(JSON_OBJECT, '$.error_message' returning varchar(256)), '');

For multiple values use:
select ... from json_table(JSON_OBJECT, '$.', ...);

..an example of which can be found here https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffathert%2Fjson-rpg-example%2Fblob%2Fmaster%2Fjson.sqlrpgle&amp;data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225588554&amp;sdata=uvi00WA9rIDfXNlu8670nLpNPqiA%2FkewU1NT88xagYY%3D&amp;reserved=0

Tim.

________________________________
From: WEB400 <web400-bounces@xxxxxxxxxxxxxxxxxx> on behalf of Cabero <cabero@xxxxxxxxxxxxx>
Sent: 27 February 2020 10:33
To: WEB400@xxxxxxxxxxxxxxxxxx <WEB400@xxxxxxxxxxxxxxxxxx>
Subject: [WEB400] JSON

Hello All.

I parse JSON data using YAJL in RPG [1]but can't consume JSON.
Can anybody point me to working open source doing so please.
Scott Klement's article was easy to follow for providing JSON. [2]
One comment on LinkedIn insinuated YAJL is not the way to go but IWS?

--
Yours sincerely.
Esteban Cabero
https://nam11.safelinks.protection.outlook.com/?url=www.linkedin.com%2Fin%2Fcabero&amp;data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225588554&amp;sdata=Fmod8vY8M%2FoU%2FvMBstkN4h1355QkB%2F3C1ED3k%2Fw352E%3D&amp;reserved=0
Cell: +27(0)843963122

Links:
------
[1]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fibmrestapi.blogspot.com%2Fp%2Fsacascr1-totallyfully-free-rpg.html&amp;data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225588554&amp;sdata=402TnZJxcmhn0J8buu1VSpmgvFtNCwtla1USKOEnU6I%3D&amp;reserved=0
[2] https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fibmrestapi.blogspot.com%2Fp%2Fblog-page.html&amp;data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225588554&amp;sdata=tiiL5Do771co1F0a%2FwXK8SID6Kg%2FCrG3VziQXKyE7vE%3D&amp;reserved=0
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Fweb400&amp;data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225598549&amp;sdata=NbkGFU18Nede58DruTPr4lns3HcgOSOjzGLDFngtTD0%3D&amp;reserved=0
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Fweb400&amp;data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225598549&amp;sdata=a9PjVkP6qhsS5cm%2BnB%2BkKCD0h0t2fA5n%2FCDhxkS95Kw%3D&amp;reserved=0.

--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Fweb400&amp;data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225598549&amp;sdata=NbkGFU18Nede58DruTPr4lns3HcgOSOjzGLDFngtTD0%3D&amp;reserved=0
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Fweb400&amp;data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225598549&amp;sdata=a9PjVkP6qhsS5cm%2BnB%2BkKCD0h0t2fA5n%2FCDhxkS95Kw%3D&amp;reserved=0.



--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Fweb400&amp;data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225598549&amp;sdata=NbkGFU18Nede58DruTPr4lns3HcgOSOjzGLDFngtTD0%3D&amp;reserved=0
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Fweb400&amp;data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225598549&amp;sdata=a9PjVkP6qhsS5cm%2BnB%2BkKCD0h0t2fA5n%2FCDhxkS95Kw%3D&amp;reserved=0.

--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.