android.database.sqlite.SQLiteException 中的 SQL 错误:无法识别的令牌
我正在查询 android 日历数据库并寻找具有特定 'iCalGUID' 的事件。
这是我正在使用的查询
final Cursor cursor = resolver.query(uri.getCalendarUri(),
null, "events.iCalGUID=" + uid, null, null);
当前 uid 是 0804eaa1-3472-43df-96c2-af73ae5c31ab
但我在执行此查询时遇到异常
android.database.sqlite.SQLiteException: unrecognized token: "0804eaa1": ,
while compiling: SELECT originalEvent, visibility, rrule, hide_declined, reminder_type, hasAlarm,
description AS suggest_text_2, rdate, transparency, timezone, dtstart, _sync_time, hasAttendeeData,
commentsUri, description, reminder_duration, htmlUri, _sync_account, _sync_version, hasExtendedProperties,
last_update_time, eventLocation, dtend, allDay, organizer, sync_source, deleted, url, originalInstanceTime, alerts_vibrate, importance, selfAttendeeStatus, eventTimezone, ownerAccount, _sync_account_type, lastDate, guestsCanModify, guestsCanSeeGuests, exrule, selected, title, _id, _sync_id, alerts_ringtone, calendar_id, access_level, _sync_local_id, title AS suggest_text_1, originalAllDay, iCalGUID, _sync_dirty, duration, parentID, color,
guestsCanInviteOthers,
exdate, eventStatus FROM view_events WHERE (1)
AND (events.iCalGUID=0804eaa1-3472-43df-96c2-af73ae5c31ab)
我如何在 android 中执行此操作 谢谢。
I am querying the android calendars db and looking for an event with particular 'iCalGUID' .
here is the query I am using
final Cursor cursor = resolver.query(uri.getCalendarUri(),
null, "events.iCalGUID=" + uid, null, null);
Current uid is 0804eaa1-3472-43df-96c2-af73ae5c31ab
But I am getting an exception while executing this query
android.database.sqlite.SQLiteException: unrecognized token: "0804eaa1": ,
while compiling: SELECT originalEvent, visibility, rrule, hide_declined, reminder_type, hasAlarm,
description AS suggest_text_2, rdate, transparency, timezone, dtstart, _sync_time, hasAttendeeData,
commentsUri, description, reminder_duration, htmlUri, _sync_account, _sync_version, hasExtendedProperties,
last_update_time, eventLocation, dtend, allDay, organizer, sync_source, deleted, url, originalInstanceTime, alerts_vibrate, importance, selfAttendeeStatus, eventTimezone, ownerAccount, _sync_account_type, lastDate, guestsCanModify, guestsCanSeeGuests, exrule, selected, title, _id, _sync_id, alerts_ringtone, calendar_id, access_level, _sync_local_id, title AS suggest_text_1, originalAllDay, iCalGUID, _sync_dirty, duration, parentID, color,
guestsCanInviteOthers,
exdate, eventStatus FROM view_events WHERE (1)
AND (events.iCalGUID=0804eaa1-3472-43df-96c2-af73ae5c31ab)
How could I do this in android
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
Try this: