Oct-14-2021, 12:17 AM
First time working with a SQL database...
I have the following database:
Thanks in advanced.
I have the following database:
+------------+-------------------+--------------+--------------+-----------------+--------------+------------+ | meeting_id | user_id | meeting_date | meeting_time | meeting_name | participants | message_id | +------------+-------------------+--------------+--------------+-----------------+--------------+------------+ | 1 | 95707125543604224 | 10/12/2021 | 8:00 | Interivew | | 8953470 | +------------+-------------------+--------------+--------------+-----------------+--------------+------------+ | 2 | 95707125543604224 | 10/14/2021 | 12:00 | 1 on 1 w/ John | | 5270659 | +------------+-------------------+--------------+--------------+-----------------+--------------+------------+ | 3 | 75123547643604126 | 12/25/2021 | 13:30 | Christmas Lunch | | 5468943 | +------------+-------------------+--------------+--------------+-----------------+--------------+------------+ | 4 | 75123547643604126 | 12/28/2021 | 11:00 | Staff Meeting | | | +------------+-------------------+--------------+--------------+-----------------+--------------+------------+I need to update the message_id and participants field once users start accepting the meeting invite. I'm using the following code to grab the last row based on the unique, sequential meeting_id field:
last_meeting = db.execute("SELECT TOP 1 * FROM meetingData ORDER BY meeting_id DESC")I'm grabbing the last row because this will be executed just after the meeting row is created in the database and passed to another function to modify. The output of last_meeting is:
Output:<aiosqlite.context.Result object at 0x0000021F037C6F40>
My question is how do I use this information now to update the fields for this row?Thanks in advanced.