Need to update "YYY" value in the field (Cust_Segment) from the value "XXX" using Sql | Community
Skip to main content
Level 2
February 2, 2026
Question

Need to update "YYY" value in the field (Cust_Segment) from the value "XXX" using Sql

  • February 2, 2026
  • 2 replies
  • 39 views

Hi Everyone,

 

I need to update the value(XXX) in the field namely “Cust_Seg” to value(“YYY”) for more than 1000 records using SQL query function. Can you please help on this. 

 

Thanks 

Saravanakumar

2 replies

Level 2
February 2, 2026

Hi Saravanakumar,

Is this related to AEP or SQL Query on Campaign?

Level 2
February 2, 2026

Related to AEP

Level 2
February 2, 2026

@SaravanakumarB1 thanks for clarifying, just note that update is not supported in SQL terms in AEP so it should be a re-insert again with correct data and based on the OOTB timestamp merge policy the latest version will reflect in the profile store.

  • Pause your ingestion dataflow which is loading this dataset, and take a full backup of the existing records in a 2nd non profile dataset
  • Use the backup dataset as primary source and write your SQL by performing the data manipulations you require and write back the result in the original dataset. Now you have clean data.
  • Wait for the UPS ingestion of this sql based insert and the re-enable the normal ingestion.

    The other way is to upsert enable your primary dataset in that case you can perform all the above actions however the benefit is you don’t need to update all the columns along with the modified ones, only updating modified columns will case the update on the same key.

    The assumption of the above is that you have a profile enabled schema and dataset and this attribute is not participating in keys or joins, in that case it would be a bit more work where you might need data hygiene to clean the system.

    You can always refer - SQL Syntax in Query Service | Adobe Experience Platform.
Level 2
February 2, 2026

@SaravanakumarB1 Will this be just for an one time load or an incremental load?

Level 2
February 2, 2026

Single time load

Level 2
February 2, 2026

@SaravanakumarB1  If your goal is to change the Cust_Seg value from “YYY” to “XXX”.

Assumption: Dataset is profile enabled and this Cust_Seg is not a identity or join key.

Then you can go ahead with re-inserting only the modified attributes.

The query will look something like this:

INSERT INTO custseg_dataset select STRUCT (customerid, CustSeg, datetime) AS _tenantname
  FROM (
SELECT
  t._tenantname.customerid AS customerid,
  'XXX' AS CustSeg,
  current_timestamp AS datetime
FROM custset_dataset t
WHERE t.__tenantname.CustSeg = 'YYY')