Bad plan. Use prepared statements and bind. Otherwise you're going to
create SQL injection vulnerabilities. Prepared statements are faster and
easier to read anyway.

John

-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of liubin liu
Sent: Wednesday, October 28, 2009 10:49 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] How to input a double num?


Now I use the sqlite3_mprintf() and the "%f" to get the double num. My
code
is below.

Now there is a num like "212345678901234567890123456.988290112". With
the
way of "sqlite3_mprintf()" and "%f", the num is cut to
"212345678901234600000000000.000000".


How to input the num "212345678901234567890123456.988290112"?


code_________________________________________________

...
    char *query_format = "INSERT OR REPLACE INTO pow_value_st (id,
valid,
powervalue_1, powervalue_2) VALUES (%d, %d, %f, %f)";
    char *query_string = NULL;
    query_string = sqlite3_mprintf (query_format, index, tc->valid,
tc->powervalue[0], tc->powervalue[1]);
    printf ("%s\n", query_string); 
...

-- 
View this message in context:
http://www.nabble.com/How-to-input-a-double-num--tp26105457p26105457.htm
l
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to