Could you show the SQL-Statement in embedded SQL?
Could it be you are using a Common Table Expression or nested sub-selects,
for generating JSON information that is used in the final SELECT statement?
If so you have to add FORMAT JSON after each generated JSON information used
in another Common Table Expression or nested Sub-Select or final SELECT
statement.
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
Modernization ? Education ? Consulting on IBM i
Database and Software Architect
IBM Champion since 2020
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
"Train people well enough so they can leave, treat them well enough so they
don't want to. " (Richard Branson)
"Learning is experience ? everything else is only information!" (Albert
Einstein)
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Jay Vaughn
Sent: Friday, 20 September 2024 16:20
To: RPG programming on the IBM i (AS/400 and iSeries)
<rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: rpg embedded sql json and escaped output
I have an rpg pgm doing some embedded sql and using json_object.
It consists only of about 5 fields all char fields...
In debug, when I view the output it is escaped.
When I code this same json_object in ACS run sql scripts (with hard coded
values), there are no escape characters in the output.
What is causing the escape char in my output in by rpg pgm when debugging?
Also, there is more json around this json_object, and this particular
json_object is nested... but still, none of the other structures should
impact this one in regards to the escaping, correct?
I have tried "format json" for each field as well with no luck - and I do
not even had to specify "format json" in my ACS run sql.
any clarification would be appreciated.
thanks
Jay
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.