I want to insert several pieces of data (include blob) into a table in a
transaction by programing in C language , like:
char *sql[n+2];

sql[0] = sqlite3_mprintf ("BEGIN;");

char *sql_f = "INSERT OR REPLACE INTO collstate VALUES (%d, %d, ?);";
for (i=1; i<n+1; i++)
    sql[i] = sqlite3_mprintf (sql_f, st_mydata[i].m1, st_mydata[i].m2);

sql[0] = sqlite3_mprintf ("COMMIT;");

sqlite3_prepare_v2 (db, sql*, -1, p_stmt, NULL);      // How to patch
several sql words like above into one sql words?
for (i=1; i<n; i++)
    ret = sqlite3_bind_blob (p_stmt, i, st_mydata[i].data, sizeof
(st_mydata[i].data), SQLITE_STATIC);


-- 
View this message in context: 
http://old.nabble.com/How-to-patch-several-sql-words-into-one-words-tp27942977p27942977.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to