Node-red-node-sqlite - "msg.topic" size restriction?

I have a successful node which inserts data into a SQLite DB using the "msg.topic = "INSERT INTO [blah].." method.

When I tried to replicate this in a node which generates a larger array of columns/values, it failed. I noticed that "msg.topic" is defined in the returned error as "string[256] however my "msg.topic" is frequently over 520 characters (I think I see where the problem lies!).

Can anyone advise a better way to insert this data into the table please?

Hi @MikeG996, welcome to the forum.

There does not seem to be a 256 character limit to msg.topic for the INSERT statement, my flow is happily executing 400+ character INSERTs.
Perhaps the node only returns 256 characters in the error message.

Can you show us an example of your msg.topic before you send it to SQLite?

Feed it to a debug node, then use the "Copy value" button in the debug panel and the </> button here to paste it into your reply.

The error message would be good to see too.

Hi @jbudd , many thanks for your reply.

I actually resolved the issue by moving the code to the "Prepared Statement" method (with a few tweaks). I must have made a mistake somewhere in the "msg.topic" approach.

Thanks again for your reply - I really appreciate your friendly, helpful & detailed response.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.