SQLite Forum

Returning expr not working with sqlite3_exec() in C code
Login
That code works fine for me.  I would suspect that you are not linking against what you think you are linking against.

How about you add the following line:

```
        printf("sqlite3 libversion: %s\n", sqlite3_libversion());
```

after the line

```
        printf("bytes_written=%llu  %s\n",bytes_written,sql);
```

and see if that sheds any light ...

```
bytes_written=0  insert  INTO mqtt6 values ('abcd',1623066863471168257,1623066863471168257,35) RETURNING (SELECT sum(size_t) from mqtt6);
sqlite3 libversion: 3.36.0
```