Starting in SQL Server 2016, you have the ability to Format Query Results as JSON. With the ability in SQL Server2016 and later, you can create milti-level JSON:
I know that IBI has ON TABLE HOLD FORMAT JSON, however it only has the ability to show data in a single level (please correct me if I'm wrong).
So, my question is, has anyone been able to do a SQL Passthru query to retrieve JSON output?This message has been edited. Last edited by: FP Mod Chuck,
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
December 21, 2019, 04:23 PM
Satheesh Babu
i did similar json format from SQL DB before IBI release the JSON Format. I created Stored procedure to return the json format and created synonym in webfocus for that stored procedure. I created procedure with PCHOLD format WP . Then in the HTML Page AJAX, called the procedure. Sometimes i used custom java script parser to manipulate the json.
WebFOCUS 8.2.04 AIX/UNIX/Windows, All Outputs
December 23, 2019, 05:02 AM
Tony A
The closest I ever got (to date) was using PUTDDREC - not exactly what you want owing to the thought required, but ...
Originally posted by Frans: is your goal to retrieve the JSON output, or pass the JSON with WebFOCUS to a client?
I am wanting to pass the JSON to a webpage into a JS charting library. So, basically using WebFOCUS like an API endpoint. I am currently using the FORMAT JSON output in WebFOCUS, but I have to do a lot of JavaScript Array and Object manipulation to get it into the proper format to pass to the charting engine. I could write a query in SQL Server that would give me the needed format. It would simplify the process if it were possible for a "SQL Passthru" to actually work like a true SQL Passthru.
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
December 26, 2019, 07:24 PM
Hallway
quote:
Originally posted by Tony A: The closest I ever got (to date) was using PUTDDREC - not exactly what you want owing to the thought required, but ...
I have done similar in WF 8201 for Year calendar and Kendo Grid.
1. Create a Stored procedure that should return your json. 2. In webfocus Create a procedure and choose Format WP. 3. Use the HTML Form to Store it as variable. 4. You can call this Procedure in the AJAX. 5. The result format will be in JSON .
TABLE FILE SP_REMINDER_DETAIL_SELECT_JSON_FOR_CALENDAR
PRINT
SP_REMINDER_DETAIL_SELECT_JSON_FOR_CALENDAR.ANSWERSET1.VALIDJSON AS ''
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE HOLD AS REMINDER_DETAILS FORMAT WP
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/warm.sty,
$
TYPE=REPORT,
COLUMN=N1,
$
ENDSTYLE
END
-RUN
SET HTMLFORMTYPE=TXT
-HTMLFORM BEGIN
!IBI.FIL.REMINDER_DETAILS;
-HTMLFORM END