Selecting From Data Extensions in SalesforceMarketingCloud
The connector offers the possibility to select, insert, update, and delete data from data extensions as relational tables. To query a data extension, simple enter its name in the format DataExtensionObject_Name where Name is the name of your data extension.
Selecting data from data extensions
SELECT * FROM DataExtensionObject_fsefes3
SELECT * FROM DataExtensionObject_fsefes3 WHERE FieldName1 = 'One'
Note 1: All filters which work with normal tables/views also work with data extensions.
Note 2: If your Salesforce Marketing Cloud account contains more than one Business Unit, then the ClientID input has to be specified. You may use semi-colons (;) to specify more than one ClientID.
SELECT * FROM DataExtensionObject_fsefes3 WHERE ClientID = '1234567'
Inserting data into data extensions
INSERT INTO DataExtensionObject_fsefes3(FieldName1, FieldName2, FieldName3) VALUES ('One', 'Two', 'Three')
Updating data from data extensions
UPDATE DataExtensionObject_secondtest15 SET [Name] = 'ChangedFromTheApi' WHERE [Email Address] = 'firstname.lastname@example.org'
Note: A primary key has to exist for this data extension for the update to work.
Deleting data from data extensions
DELETE FROM DataExtensionObject_secondtest15 WHERE [Email Address] = 'email@example.com'
Note: A primary key has to exist for this data extension for the deletion to work.