Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tandem select in SQLCI to JSON format

196 views
Skip to first unread message

Anna Bari

unread,
Mar 11, 2018, 1:34:11 PM3/11/18
to
Can select in SQLCI in Tandem HP be translated to JSON format

Keith Dick

unread,
Mar 12, 2018, 12:04:35 AM3/12/18
to
Anna Bari wrote:
> Can select in SQLCI in Tandem HP be translated to JSON format

As far as I know, there is no command options in SQLCI (nor in mxci) that will take output of a SELECT and change it to JSON. There might be some third-party utilities available that will produce JSON from the results of a SELECT, but if so, I don't know about any of them.

If you are willing to write a small program in Java and use JDBC, there are Java packages that make it a pretty simple programming job to take the result set from a Select query and produce JSON from that. If you run that Java program on the NonStop system, you can access the SQL/MP table directly using the SQL/MP JDBC driver. If you want to run the Java program on a different system than the NonStop system, you should create a SQL/MX alias for the SQL/MP table, then you can use the SQL/MX JDBC driver to access the SQL/MP table via the SQL/MX alias for the SQL/MP table.

Randall

unread,
Mar 12, 2018, 2:48:50 PM3/12/18
to
If you are really interested in scripting the translation, one cool way of doing it is to wrap the SQL SELECT operation in Groovy instead of a distinct Java program. Groovy is a Java-like scripting language that ports easily to OSS - ITUGLIB uses it for packaging, and we load the JDBC type 2 driver in Groovy and manipulate our database that way. You can load and use jars in Groovy, including JSON converters. The down-side is, as with Keith's suggestion, you have to be Java-aware and set up an SQL/MX alias.

Pierre

unread,
Mar 13, 2018, 11:31:24 AM3/13/18
to
On Sunday, 11 March 2018 18:34:11 UTC+1, Anna Bari wrote:
> Can select in SQLCI in Tandem HP be translated to JSON format

Hi Anna,

I haven't tried the Python option, but worth a shot on ODBC from PC.

On of many many examples Googling: https://anthonydebarros.com/2012/03/11/generate-json-from-sql-using-python/


@keith

do you recon HPE NonStop SQL/M? can be added to the https://www.connectionstrings.com/ ?

Keith Dick

unread,
Mar 13, 2018, 2:38:22 PM3/13/18
to
That connectionstrings.com site seems to be for ODBC rather than JDBC. While I think JDBC is related to ODBC, I don't know anything about ODBC. The connection strings listed on that site for MySQL, another database I'm familiar with, don't look anything like the JDBC connection strings used with MySQL, so I feel I don't know enough to undertake adding information about using ODBC with NonStop systems to that site. Maybe someone else who sees your post will feel qualified to do something about it.

april...@gmail.com

unread,
May 17, 2018, 7:59:11 AM5/17/18
to
On Sunday, March 11, 2018 at 1:34:11 PM UTC-4, Anna Bari wrote:
> Can select in SQLCI in Tandem HP be translated to JSON format

Thank you . I used TACL to create it. Nothing I could figure out otherwise
0 new messages