SQLite Forum

Returning expr not working with sqlite3_exec() in C code
Login
That code fragment cannot possibly result in the text shown.  The variable sql will point to a text string that contains:

`insert or REPLACE INTO mqtt6 values.('abcd',something,something,35)`

which looks absolutely nothing like the output you have provided.

What is the version of SQLite3 that you are linking with?  Perhaps it does not understand the "returning" clause.  (The sqlite3 CLI is an SQLite3 Application and does not have to be linked against the same version of SQLite3 as a.out is being linked to).