Mahalakshmi.m
<[EMAIL PROTECTED]>
wrote:
> I want the statement to be like:
>
> "SELECT id, Name FROM MUSIC WHERE Name >= '1a' LIMIT 1;"
>
> But using prepare I could not able to get the desired statements.
>
> I want to bind unsigned short as text.
There are no parameters in your statement. What exactly do you plan to
bind to?
> Unsigned char u8_ClassificationCode=1;
>
> Unsigned short u16_Input=0x0061;
>
> if ( sqlite3_prepare(gpst_SqliteInstance,"SELECT id, Name FROM MUSIC
> WHERE Name >= '%d%c' LIMIT 1;",-1,&pst_SearchPrepareStmt,0)!=
> SQLITE_OK)
You seem to think sqlite3_prepare works like printf, what with you using
%d and %c. It doesn't. %d and %c have no special meaning in a SQL
statement. Your statement has no parameters to bind.
Try something like this:
wchar_t text[10];
wsprintf(text, L"%d%c", u8_ClassificationCode, u16_Input);
sqlite3_prepare(gpst_SqliteInstance,
"SELECT id, Name FROM MUSIC WHERE Name >= ? LIMIT 1;",
-1, &pst_SearchPrepareStmt, 0);
sqlite3_bind_text16(pst_SearchPrepareStmt, 1, text, -1,
SQLITE_TRANSIENT);
Igor Tandetnik
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users