Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

Why my Json data changes after inserting to Mysql longtext column

$
0
0

Hi ,

I am retrieving json data from API and then saving it to my mysql table in longtext datatype (my json string can be very huge ).

Issue:

when i retrieve it back , its gets changed

string i inserted and when i retrieve it back from table it comes like below:

Below is just part of huge json data string,i am pasting the difference part only found through notepad++comparison 

Original json inserted
"test_step_value": "[\r\n {\r\n \"device\": \"Sample\",\r\n \"location\": \"Non-coco Region\",\r\n \"panel\": \"CO\"\r\n }\r\n]",json data retrieve back from mysql"test_step_value": "[ {"device": "Sample","location": "Non-cocoRegion","panel": "CO" } ]",

Problem

I am parsing the string using json.net which works good for the original json data, but when i retrive it back from table and try to parse it gives error due to changes in data automatically in mysql.

I want mysql to save my data as it is and give it back same.... this problem does not come when i save this in sql varchar(max)

Thanks in advance!


Viewing all articles
Browse latest Browse all 1350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>