Get result of 'pragma foreign_keys' in c programme

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Get result of 'pragma foreign_keys' in c programme

curmudgeon
I thought

sqlite3_prepare16_v2(DB,"pragma foreign_keys",-1,&stmt,NULL)

would work but it doesn’t return SQLITE_OK.

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Get result of 'pragma foreign_keys' in c programme

Jens Alfke-2


> On Nov 20, 2017, at 9:08 AM, x <[hidden email]> wrote:
>
> sqlite3_prepare16_v2(DB,"pragma foreign_keys",-1,&stmt,NULL)

That function expects a UTF-16 encoded string (hence the “16” in the name), but you’re giving it an 8-bit C string.
Just call sqlite3_prepare_v2 instead.

—Jens
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Get result of 'pragma foreign_keys' in c programme

curmudgeon
Thanks Jens, working now.



--
Sent from: http://sqlite.1065341.n5.nabble.com/
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users