Hi,

I want to know why we have to use sqlite3_mprintf before sqlite3_prepare()

Case 1:
Query = sqlite3_mprintf ("DELETE FROM MUSIC WHERE URL = ?;");
sqlite3_prepare(db, Query ,-1,&stmt,0);
sqlite3_free(Query);

case 2:
We can also use directly - sqlite3_prepare(db, "DELETE FROM MUSIC WHERE URL
= ?;",-1,&stmt,0);

Will there be any performance difference between case 1 and case2.Kindly
help me to solve.Right now I am directly passing the Sqlite staments inside
sqlite3_prepare().Do I need to use sqlite3_mprintf or not needed.

Sometimes I am using sprintf instead of sqlite3_mprintf.will both have the
same functionality.After calling sqlite3_mprintf()we are freeing using
sqlite3_free but not sprintf().

sprintf(buff,"DELETE FROM MUSIC WHERE URL = ?;");
sqlite3_prepare(db, buff,-1,&stmt,0);


Thanks & Regards,
Mahalakshmi


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

Reply via email to