Issue with yajil_buf_load_tree From a VARCHAR string

Discussions relating to the ScottKlement.com port of the open source YAJL JSON Reader/Generator. This includes the YAJL tool as well as the YAJLR4, YAJLGEN, YAJLINTO and YAJLDTAGEN add-ons from ScottKlement.com. http://www.scottklement.com/yajl/
Post Reply
abermudez
Posts: 4
Joined: Tue Aug 15, 2023 9:06 pm

Issue with yajil_buf_load_tree From a VARCHAR string

Post by abermudez »

I am currently using YAJL to deconstruct a JSON string.

I am using: docNode = yajl_buf_load_tree(%addr(GetUri_Out) : %len(%trim(GetUri_Out)) : ErrMsg );

I am using GETURI to get mu HTTP Response and the GetUri_Out is a varchar(1048576) value holding the web response. When using the code above I get “parse error: premature EOF”. If I move the GetUri_Out to a char(1048576) value it works with no errors.

For performance purposes I do not wish to move a varchar to a char in order to process it. Is there a way to load a varchar value using yajl_buf_load_tree or is there another method I should be using?

Thanks,
Angel Bermudez
abermudez
Posts: 4
Joined: Tue Aug 15, 2023 9:06 pm

Re: Issue with yajil_buf_load_tree From a VARCHAR string

Post by abermudez »

OK I resolved the varchar() issue .

I used docNode = yajl_buf_load_tree(%addr(GetUri_Out:*data) : %len(GetUri_Out) : ErrMsg );

and I get no more errors.
Post Reply