Questions tagged [json-extract]

This tag is intended for questions dealing with accessing and reading data elements or series in JSON objects and/or representing such data elements or series with transformations.

126 questions
10
votes
2 answers

Extract JSON object's values as array from MySQL JSON column

I have a MySQL column of json type. In there, a dict like JSON object is stored. Now, I want to extract the values from this JSON object and create a JSON array. How can I achieve this? Example Query with json_objs(json_col) as ( select…
Yuki Inoue
  • 3,569
  • 5
  • 34
  • 53
4
votes
2 answers

read json array on mysql query

I know about the possiblity of duplicity of question but i don't found anything to help me on my situation about it. I have this json on my mysql column: [ { "ddi": "55", "routing_id": "7", "price": { "mt": 0.0285, "mo":…
4
votes
1 answer

How to input dynamic key to json_extract mysql?

I have one table (call it abc) like below: The column named 'likelihood'is a JSON Object (key-value). I have another table (lets call it xyz) that contains CustomerId and key(an integer value) columns. I am joining the two tables above based on…
solomon1994
  • 386
  • 2
  • 10
3
votes
1 answer

Extract keys and values from json string in bigquery where there is no specified key in the json document

I have a table in bigquery where I have object and for each object I have some stringified json. In json, an example row look like below: { "ObjectID": "1984931229", "indexed_abstract":…
Syed Arefinul Haque
  • 1,123
  • 2
  • 14
  • 38
3
votes
1 answer

JMeter- extract multiple variables from JSON response and save it in CSV file

I have seen several posts related to this, but I couldn't find a close match to my scenario, hence posting it as a new question. I have a below JSON response { "myshop": [ { "url": "test1", "hits": 1000 }, { "url":…
Butner
  • 81
  • 1
  • 9
2
votes
2 answers

How to add a variable from Json extractor into an array in JMeter?

I'm new here and also a beginner on JMeter and maybe this was already answered in an old post that I didn't find, sorry if this is the case. I had this Post request I need to send with all these IDs that vary according to the account Post Request In…
2
votes
2 answers

JSON_Extract error: Invalid JSON text in argument 1 to function json_extract: "Missing a name for object member."

I'm trying to extract "name" from JSON column "Value": Table t: id Value 1 [{'id': 116298, 'name': 'Data Analysis', 'language': 'en'}, {'id': 5462, 'name': 'Visualization', 'language': '00'}] My query is: select…
Meital
  • 33
  • 2
  • 2
  • 4
2
votes
1 answer

StandardSQL BigQuery values from key:value pairs within an Array into separate columns. How?

I have a BigQuery table with an array column, with multiple (1 to 4) key:value pairs separated by a pipe "|". I want to pull the key:value pairs and add additional columns with the 'key' as the column header and the 'value' as... well the…
acakaliman
  • 83
  • 1
  • 7
2
votes
0 answers

JSON_EXTRACT on array of objects in MYSQL

How to search in array of objects in mysql using JSON_EXTRACT ? Here is the data json [ { "prd_type": "stand_alone", "prd_unitprice": 70 }, { "prd_type": "stand_alone", "prd_unitprice": 50, } ] and here is my query, this…
mobeen
  • 158
  • 1
  • 10
2
votes
1 answer

Extracting first key of JSON extract in MySQL

These are the columns and values of my table: ID | RULE 123 | {"buy":{"10000":{"q":1}},"total":{"t":"DOLLAR_OFF","v":4.05}} 445 | {"buy":{"11000":{"q":1}},"total":{"t":"DOLLAR_OFF","v":2.25}} My expected output: ID | ArticleInfo 123 | 10000 445 |…
2
votes
2 answers

Querying records before a date from a JSON item's date in a JSON column in MySQL

I am querying from a JSON field in the MySQL database which seems to work okay so far. It gives me records. But my issue is that I can't select where an item date in the JSON string is before a certain date. It seems to give me records before and…
JamLizzy101
  • 155
  • 1
  • 6
2
votes
3 answers

Use same parameter more than one request after fetching using JSON Extractor

Fetching data from one post response and reusing it for two other requests using JSON Extractor in Jmeter. After reusing the response param for the first request the second request can't reuse the response and shows the default value used in JSON…
bubka85
  • 59
  • 5
2
votes
1 answer

How to use sqlite json1 features such as json_extract, json_each, json_tree using ORM DB API of flask-sqlalchemy?

I want to use json_extract, json_tree, json_each features of JSON1 Extension enabled sqlite3 database with flask-sqlalchemy. With reference to link here, I am making ORM query as below: Model class EventHistory(db.Model): timestamp =…
2
votes
2 answers

Why JSON_EXTRACT wildcard with LIKE% or %LIKE does not work in MySQL database?

I need to search for data in MYSQL table with JSON data. Using JSON_EXTRACT(@json, "$.link") LIKE '%http%' works as expected. But LIKE 'http%' or '%http' dosn't! Does it means JSON_EXTRACT cant't be used with single wildcard select…
Arnis Juraga
  • 1,027
  • 14
  • 31
1
vote
1 answer

Extracting nested JSON field property Sqlite3

Fiddle link: https://www.db-fiddle.com/f/u6ZXKW8TgFkDH5o2FhppgD/0 I have a query: SELECT JSON_EXTRACT(value, '$.characterId') AS character_id, JSON_EXTRACT(value, '$.voiceActor') AS voice_actor, JSON_EXTRACT(value, '$.voiceActor') AS…
appleman
  • 150
  • 1
  • 10
1
2 3
8 9