Reputation: 2251
Im simply trying to insert json data into a dynamic column.
Data looks like follows:
"{"Fields": {
"CompanyCode": "1",
"FiscalYear": "2014",
"CalYear": "2014",
"CalPeriod": "1",
"MinPostDate": "2014-01-14T00:00:00",
"MaxPostDate": "2014-01-14T00:00:00",
"CreditDebitInd": "H"
}
}"
Query is like this:
INSERT INTO jsontest (ID, Text) VALUES(DEFAULT, 'JsonHere');
ID is an ID which is the PK and it auto increments. Text is a BLOB
Upvotes: 0
Views: 1531
Reputation: 2251
INSERT INTO test VALUES(DEFAULT, '{"Fields": {
"CompanyCode": "E009",
"FiscalYear": "2014",
"CalYear": "2014",
"CalPeriod": "1",
"MinPostDate": "2014-01-14T00:00:00",
"MaxPostDate": "2014-01-14T00:00:00",
"CreditDebitInd": "H"
}
}');
I was using the ` symbol to encapsulate the data. It needs to be the ' symbol
Upvotes: 2