Been fighting with this for a couple of hours. I'm trying out httpPostClob, so I'm trying to replace an existing/working REST call made with HTTPAPI + YAJL.
Using HTTPAPI, I was able to define response as 100000a. Now that I'm using response in an SQL statement, I had to change back to 32000a.
This concerns me because I'm going to truncate data easily. I'm wondering if anyone else is using httpPostClob and how they work with data limits? Do I need to also use JSON_TABLE to handle the return data? I'm very comfortable with YAJL and how I can deal with arrays and nested array. I'm not sure how JSON_TABLE handles all of that.
Thanks in advance.
Mike
This is the added hoop to jump through since using httpPostClob, because this works with a CLOB, but the YAJL function below doesn't.
Using HTTPAPI, I was able to define response as 100000a. Now that I'm using response in an SQL statement, I had to change back to 32000a.
This concerns me because I'm going to truncate data easily. I'm wondering if anyone else is using httpPostClob and how they work with data limits? Do I need to also use JSON_TABLE to handle the return data? I'm very comfortable with YAJL and how I can deal with arrays and nested array. I'm not sure how JSON_TABLE handles all of that.
Thanks in advance.
Mike
Code:
d response s 32000a varying d returnData s sqltype(clob:1000000) d requestData s sqltype(clob:1000000)
Code:
exec sql select systools.httpPostClob( :url, cast(:header as clob(1k) ccsid 1208), cast(:requestData as clob(20k) ccsid 1208)) into :returnData from sysibm.sysdummy1 ;
This is the added hoop to jump through since using httpPostClob, because this works with a CLOB, but the YAJL function below doesn't.
Code:
exec sql select cast(cast(:returnData as clob(20k) ccsid 1208) as varchar(32000)) into :response from sysibm.sysdummy1 ;
Code:
docNode = yajl_buf_load_tree( %addr(response: *data) : %len(%trimr(response)) : errMsg );
Comment