Weird output after creatin using sqlite3

I have a coded a C program which reads data via tcp and stores it in an sqlite database. I'm as far as reading the data and writing it to the stdout the output looks like that:

hex: 9C11030003D1008122
bin: 100111000001000100000011000000000000001111010001000000001000000100100010
hex: 9C11030003D1008122
bin: 100111000001000100000011000000000000001111010001000000001000000100100010
hex: 9C11030003D1008122
bin: 100111000001000100000011000000000000001111010001000000001000000100100010

but if I add this code after the output

sqlite3_stmt* res;
char*sql = "INSERT INTO telegram(timestamp,hex, bin) VALUES(?,?,?);";
sqlite3_prepare_v2(db->dbcon, sql, -1, &res, 0);
sqlite3_reset(res);
sqlite3_finalize(res);

I don't even insert data yet, because I wanted to try where the problem is. So the output is then:

hex: BC11030002D1008002
bin: 101111000001000100000011000000000000001011010001000000001000000000000010
hex: ▒9C11030002D1008022
bin: ▒▒10011100001000100000011000000000000001011010001000000001000000000100010
hex: ▒9C11030002D1008022
bin: ▒▒10011100001000100000011000000000000001011010001000000001000000000100010
hex: ▒9C11030002D1008022
bin: ▒▒10011100001000100000011000000000000001011010001000000001000000000100010

as you can see the first output is ok, becaus after that I execute the sqlite3code the first time.

Any Idea why this is happening?