I have written a user defined function to calculate checksum for a given string. I need to insert the calculated hash value into the table. I used the following method
char msg[] = "Testing of the hash"
len = strlen(msg)
char *sql = "INSERT INTO TestHash (id,CheckSum) VALUES (?,hash(msg,len));"
sqlite3_prepare_v2(db, sql, -1, &res, 0);
sqlite3_step(res)
but sqlite throws a error "failed to prepare insert sql statement:no such column:msg". What is the right way to call a UDF in insert command.
Platform:linux Language:C database:sqlite
Thanks for the help in advance