Hi Jun,I am not sure, what you tried already. When I place the following text into a JDBC Sampler's query field, I get no errors:
createtablesomething(idint,datajson);
insertintosomethingvalues(1,'{"name": "whatever"}'::json);
Same result, when I remove the casting and use
createtablesomething(idint,datajson);
insertintosomethingvalues(1,'{"name": "whatever"}');
Can you show us a minimal example that fails for you?
Regards
Felix
Am 01.12.23 um 23:24 schrieb Jun Zhuang:
Hi,
I am getting Cannot have quote-char in plain field:['{"] error when trying to
insert a JSON string into a Postgres DB table using JDBC request.
I tried the following but nothing worked:
- place the JSON string in single quotes,
- escaping the double quotes with \",
- placing the string in $$<JSON string here>$$ but nothing worked.
There is no issue with the connection and other select/insert queries and I was
able to insert from pgAdmin with the same string in single quotes though.
The JSON string looks like this: {"A":"A", "B":[{"C":"C"}]}
I am really out of ideas at this time. Can someone help?
Thanks,Jun
OpenPGP_0xEA6C3728EA91C4AF.asc
Description: OpenPGP public key
OpenPGP_signature.asc
Description: OpenPGP digital signature
