3 weeks ago
Hi,
SAP SQL AnyWhere 17.0.10.
There is some JSON packet. I pass it to the procedure "sp_parse_json" for processing
declare cJSON long varchar;
call dbo.sp_parse_json('sql_array', cJSON);
I will get the parsed JSON package into the variable "sql_array".
Question: How do I check "sql_array" for the presence of a certain field in a JSON packet? JSON-package, whether this field is there or not ?
Request clarification before answering.
A similar question has been discussed years ago in the separate SQL Anywhere Forum (y'know, the forum with easily searchable contents - whereas I now need to google via "sp_parse_json site:sqlanywhere-forum.sap.com" to find this - as a sample for PCCollin's hint to do error handling:
SQL Anywhere 17: sp_parse_json how to handle properties that are not passed when empty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In our experience the only way to do this is by using exception handling.
sp_parse_json work for basic scenarios, but as soon as there is any chance of there being variables within the structure we have found it is best to parse with an external procedure
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
30 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.