How to fetch and update DynamoDB table items by PartiQL in aws

0 votes

I have added a new column to a dynamo db table that already exists in aws. I now want a one-time script to fill in data for all current records in the newly formed column. I experimented with the PartiQL editor's cursor, as seen below, in aws.

DECLARE cursor CURSOR FOR SELECT CRMCustomerGuid FROM "Customer";

OPEN cursor;

WHILE NEXT cursor DO
  UPDATE "Customer"
  SET "TimeToLive" = 1671860761
  WHERE "CustomerGuid" = cursor.CRMCustomerGuid;
END WHILE

CLOSE cursor;

However, I am seeing the following error message: ValidationException Statement was poorly constructed and cannot be processed: unexpected word

We appreciate any assistance.

Dec 23, 2022 in AWS by Tejashwini
• 3,820 points

edited 6 days ago 9 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP