ContentValuesオブジェクトの引用符付き文字列をsqlite挿入に使用するにはどうすればよいですか? SQLiteはのどに詰まらせているようだ。私の価値insertOrThrowのContentValuesを使って引用符で囲まれた文字列を取得する
私は、このエラーが発生します//inside a for loop of a NodeList
ContentValues map = new ContentValues();
Element elm;
elm = (Element) nodes.item(i);
String elmname = elm.getTagName();
map.put("foto", getValue(elm, "foto"));
map.put("fotonormal", getValue(elm, "foto-normal"));
map.put("link", getValue(elm, "link"));
myDatabase.beginTransaction();
try {
myDatabase.insertOrThrow(TABLE_ENDING, null, map);
Log.i(TAG, "Added");
myDatabase.setTransactionSuccessful();
} catch (Exception err) {
Log.i(TAG, "Transaction failed. Exception: " + err.getMessage());
} finally {
myDatabase.endTransaction();
}
Transaction failed. Exception: unrecognized token: ":": INSERT INTO tbl_ending (fotonormal, foto, link) VALUES (https://example.com/fotonormal.jpg, https://example.com/foto.jpg, https://example.com/);
の私は、SQL文が
INSERT INTO tbl_ending (fotonormal, foto, link) VALUES ("https://example.com/fotonormal.jpg", "https://example.com/foto.jpg", "https://example.com/");
どのように私はこの出力を得ることができなければなりませんと信じて代わりに?
エラーが発生しました。トランザクションが失敗しました。例外:エラーコード19:制約に失敗しました。私はこれがあまりにも多くの引用に関連していると思う:http://stackoverflow.com/questions/5364576/android-sqliteconstraintexception-error-code-19-constraint-failed –