Skip to content
Advertisement

How to read JSON value in MySQL

The JSON output I need to insert into my database but my source code throws an error:

The source code:

Can anyone help me with this, as I need to get values for open, close, high and low.

error:

Advertisement

Answer

  1. you have 5 columns, hence 5 bind variables. Your insert template is over complicated
  2. with any database operations you should be working with batches not row by row. You really should use execute many()
  3. I assume that ohlc is JSON, just need to convert it to a string

output

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement