How to delete records where Primary Key is NULL? | Community
Skip to main content
inamw21812872
Level 2
August 7, 2019
Solved

How to delete records where Primary Key is NULL?

  • August 7, 2019
  • 5 replies
  • 5703 views

I somehow have some entries in my schema where PK Attribute is NULL.

I created the workflow by querying those rows and added Delete Data Step.. but records wont get deleted.. Error message is PK cant be NULL.                

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by pulkit2304

For ACC - You can write a SQL Script with the 'DELETE FROM <<tablename>> WHERE <<pk>> IS NULL

For ACS -

1. Create a duplicate custom resource.

2. Publish your changes

3. Load non-null pk records from your table here.

4. Mark the table for re-draft ( more details here: Deleting a resource  ) This will delete ALL the records for the table when you publish.

5. Got ahead a publish

6. Do not delete the resource, instead unselect the re-draft and publish once again. This will leave the resources but without any records.

7. Load the data that you backed up before to the original table

8. Delete the backup table ( same steps as detailed in the link above).

9. Don't let bad data get into the system again 

Thanks,

Pulkit

5 replies

John_T_Smith
Level 3
August 7, 2019

Please post the name of the program you use so a Moderator may move this message to that forum

-A program would be Photoshop or Dreamweaver or Muse or Premiere Pro or ???

Abambo
Level 2
August 7, 2019

Looks like database programming...Adobe Experience...Campaign or similar...

jane-e
Level 2
August 7, 2019

It could be an xml schema in InDesign.

Abambo
Level 2
August 8, 2019

Discussion successfully moved from Adobe Creative Cloud to Adobe Campaign Classic

Adobe Campaign Standard or Adobe Campaign Classic ?

I moved to campaign classic now. A different moderator can move to standard or even still a different forum if that is necessary.

pulkit2304Adobe EmployeeAccepted solution
Adobe Employee
August 8, 2019

For ACC - You can write a SQL Script with the 'DELETE FROM <<tablename>> WHERE <<pk>> IS NULL

For ACS -

1. Create a duplicate custom resource.

2. Publish your changes

3. Load non-null pk records from your table here.

4. Mark the table for re-draft ( more details here: Deleting a resource  ) This will delete ALL the records for the table when you publish.

5. Got ahead a publish

6. Do not delete the resource, instead unselect the re-draft and publish once again. This will leave the resources but without any records.

7. Load the data that you backed up before to the original table

8. Delete the backup table ( same steps as detailed in the link above).

9. Don't let bad data get into the system again 

Thanks,

Pulkit