android.database.sqlite.SQLiteException 中的 SQL 错误:无法识别的令牌

发布于 2024-12-07 03:25:54 字数 1333 浏览 0 评论 0原文

我正在查询 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

断桥再见 2024-12-14 03:25:54

试试这个:

final Cursor cursor = resolver.query(uri.getCalendarUri(),
                        null, "events.iCalGUID=\"" + uid + "\"", null, null);

Try this:

final Cursor cursor = resolver.query(uri.getCalendarUri(),
                        null, "events.iCalGUID=\"" + uid + "\"", null, null);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文