[sqlite] no such function problem

2012-07-31 Thread YAN HONG YE
I write a function in my program: char *ldll(char *s1) { return s1; } and use it to modify my sqlite db: sprintf(sql,insert into student select 3,ldll('bb'),22;); but the error msg is no such function: ldll ___ sqlite-users mailing list

Re: [sqlite] no such function problem

2012-07-31 Thread Rob Richardson
This is a C question, not an SQLite question. But I'll answer it anyway. You included the function call in your quoted string, so your compiler thinks it's just random text. You need: sprint(sql, insert into student select 3, %s, 22;, ldll(bb)); RobR

[sqlite] sqlite3_stat problem

2012-07-31 Thread YAN HONG YE
sprintf(sql,insert into student select 1,?,22;); sqlite3_prepare(l_db,sql,-1,stat,0); char *uu1=bb; char *uu2=Öйú; HINSTANCE mod; Connect foo; mod =

Re: [sqlite] sqlite3_stat problem

2012-07-31 Thread Keith Medcalf
sqlite3_bind_text(stat,1,uu2,140,NULL); uu2 is 4 bytes, not 140; are you sure that it is valid UTF-8 text and not a blob-o-bytes? --- () ascii ribbon campaign against html e-mail /\ www.asciiribbon.org -Original Message- From: sqlite-users-boun...@sqlite.org

Re: [sqlite] sqlite3_stat problem

2012-07-31 Thread Keith Medcalf
sqlite3_bind_text(stat,1,uu2,140,NULL); uu2 is 4 bytes, not 140; are you sure that it is valid UTF-8 text and not a blob-o-bytes? It may also be SQLITE_TRANSIENT rather than SQLITE_STATIC ... --- () ascii ribbon campaign against html e-mail /\ www.asciiribbon.org