gpt4 book ai didi

android - android android.database.sqlite.SQLiteException : unrecognized token 中的 SQL 错误

转载 作者:行者123 更新时间:2023-11-30 04:31:48 26 4
gpt4 key购买 nike

我正在查询 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中做到这一点谢谢。

最佳答案

试试这个:

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

关于android - android android.database.sqlite.SQLiteException : unrecognized token 中的 SQL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7582944/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com