Questions tagged [json-value]

77 questions
8
votes
2 answers

how to fix SQL server Json text is not properly formatted. Unexpected character is found at position 151

Im working on a table that has a column in JSON format and I want to extact the coordinate value from that column. So I run the following code: Select *,JSON_VALUE(field,'$."Coordinate-X"[0]') As coordinate INTO TABLE_1 FROM table WHERE…
Zeir
  • 249
  • 1
  • 4
  • 13
6
votes
5 answers

Export a Vimscript Dictionary as JSON

I have a found a plugin that enables Vim to parse JSON. I need to export VimScript dictionaries as JSON. Currently I am just using: let str = string(dict) substitute(str, "'", '"', 'g') This is working but is bound to break when I run into…
Sean Mackesey
  • 10,701
  • 11
  • 40
  • 66
5
votes
2 answers

SELECT JSON_VALUE From table returns null instead of value

JSON stored in a column 'DataJson' in table [{ "KickOffDate": "1-Jan-2019", "TeamSize": "11", "ClientEngineer": "Sagar", "WaitingPeriod": "16.5" }] Query SELECT JSON_VALUE(DataJson,'$.KickOffDate') AS KickOffDate ,…
Gibin Jacob Job
  • 59
  • 1
  • 1
  • 3
4
votes
2 answers

How to convert Object to javax.json.JsonValue?

I want to patch a JSON string. I get the 'path' to the field which has to be patched, and the 'value' with which to patch. The value could be anything, String, int, float, boolean, array, or an object. How do I convert the Object to JsonValue? The…
3
votes
1 answer

How do I get the "key" of an array item in OPENJSON, when using WITH?

I want to parse a json-array in my sql-server. I would like to use OPENJSON with WITH to parse specific values into columns. How can I get the index of each array item? I know, that this works fine with JSON_VALUE and without WITH: DECLARE @json…
slartidan
  • 20,403
  • 15
  • 83
  • 131
3
votes
1 answer

How to construct dynamic SQL where condition against JSON column

I have a SQL table that stores data in Json format. I am using sample data below to understand the issue. Each document type has its own JSON structure. DocumentID DocumentTypeID Status JsonData …
LP13
  • 30,567
  • 53
  • 217
  • 400
2
votes
1 answer

Sort JSON Dictionary by Value

How can I organize this JSON file in descending order by value? { "48275928194813456218": 12, "57532478653456645734": 26 } // And sort that into: { "57532478653456645734": 26, "48275928194813456218": 12 } This is what I have so…
2
votes
0 answers

How to exclude a null value computed in JsonValue from JSON serialized by Jackson?

class Wrapper(private val value: String?) { @JsonValue fun asValue(): String? { return value } } val mapper = ObjectMapper() .setSerializationInclusion(JsonInclude.Include.NON_NULL) val item = mapOf( …
diziaq
  • 6,881
  • 16
  • 54
  • 96
2
votes
1 answer

Access JSON_VALUE from SQL Column containing JSON String with Arrays

Looking to use JSON_VALUE to access some data within a JSON column in an SQL Server table. I have a table (tblMyTable) that has the following columns and data; | Column1 | JSONColumn | | -------- | -------------- | | 1 | {some JSON} …
CapnComic
  • 23
  • 3
2
votes
0 answers

raise JSONDecodeError("Expecting value", s, err.value) from None

I'm run my code to extract required data from RNA central database based RNAcentral accession number. Sometimes in the middle, the program stops and start showing this error: Error Obtained File "C:\Users\soura\Desktop\Thesis\Saurav…
2
votes
2 answers

SQL Server parse JSON to update another table

I have a table with JSON data in one of the columns and i'm trying to parse the JSON data and insert into a temp table DECLARE @TEMPTABLE ( ID INT, Status NVARCHAR(50), Cost DECIMAL(20, 0) ) INSERT INTO @TEMPTABLE SELECT …
RData
  • 959
  • 1
  • 13
  • 33
2
votes
2 answers

Oracle JSON Query with hyphen-key

I have an Oracle database in version 12.1.0.2.0 and JSON field that I want to query. This query works: select JSON_VALUE('{"-": "hello", "de":"hallo"}','$."de"') from DUAL This query returns the error ORA-40442. select JSON_VALUE('{"-": "hello",…
Peter
  • 23
  • 3
2
votes
2 answers

How to compare JSON Response with Postman

I have a scenario to validate the "status" value in the array. The response is dynamic and # iteration may vary. I don't want to save this value in my postman environment but need to make a dynamic check. From my below API Response, I got 2…
Sankar S
  • 19
  • 2
1
vote
2 answers

Extract value from a JSON array with no name

I have a table with a record that has JSON content and it is an array with no name. Sample data looks like…
sinDizzy
  • 1,300
  • 7
  • 28
  • 60
1
vote
3 answers

modifiy data of json file

How can I modify the values of json file using python? so my json file is: { "roll no": "210", "school": "DAP", "city": "Delhi", "hobbies": [ { "dance": "yes" }, { "singing": "yes" }, { "travel": "yes" }, …
user20647565
1
2 3 4 5 6