# JSON Object Does Not Insert Into SQLite Table Correctly

**URL:** <https://forum.inductiveautomation.com/t/json-object-does-not-insert-into-sqlite-table-correctly/115140>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [April 17, 2026, 1:05pm UTC](https://forum.inductiveautomation.com/t/json-object-does-not-insert-into-sqlite-table-correctly/115140 "2026-04-17T13:05:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Slick](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@Slick](https://forum.inductiveautomation.com/u/Slick)\
**Post date:** [April 17, 2026, 1:05pm UTC](https://forum.inductiveautomation.com/t/json-object-does-not-insert-into-sqlite-table-correctly/115140/1 "2026-04-17T13:05:57Z")

</div>

In an event script on a view component, I have an `INSERT` query that I run with `system.db.runPrepUpdate`. One of my columns in the table I'm inserting rows into is a `BLOB` type, and I would like to store JSON objects in it.

My trouble is that when I run the query, this blob column does not contain the JSON object I pass as an argument into the `runPrepUpdate` function. Instead, it contains some odd value that looks like an array with a serialized value in it:

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/d/6d96f3478df2429afb6bbebbd9df2fe3c2636ba1.png)

Additionally, whenever I run a `SELECT` query on this column, the serialized value changes.

I am not sure what is causing this and how to prevent it. Any ideas?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 17, 2026, 1:17pm UTC](https://forum.inductiveautomation.com/t/json-object-does-not-insert-into-sqlite-table-correctly/115140/2 "2026-04-17T13:17:50Z")

</div>

That's the stringified form of a byte array in java. It appears different because java makes a new array to hold the content on every query, and the "address" is part of the stringification.

Don't stringify blobs.

Consider not using a BLOB column.

---

<div class="post-metadata">

**Author:** ![Slick](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@Slick](https://forum.inductiveautomation.com/u/Slick)\
**Post date:** [April 17, 2026, 1:34pm UTC](https://forum.inductiveautomation.com/t/json-object-does-not-insert-into-sqlite-table-correctly/115140/3 "2026-04-17T13:34:49Z")

</div>

Changing the column type to TEXT did the trick, thanks for the advice.

What's odd to me is that I'm also converting an array to a JSON object and inserting it into the same table (different BLOB column), and the JSONed array is stored as inserted.

Not sure why there's a difference between these two cases besides the fact that one JSON object was originally an array and the other was an object/dictionary.
