|
|
Documentation Wiki > Developer Documentation > Web Service Guide > Technical Articles > Adding New Column to an Existing Data Extension
Adding New Column to an Existing Data ExtensionFrom $1(Click the banner to go to the related Docs.Code.ExactTarget.com page.) This document contains conceptual and procedural information about adding a new column to an existing data extension. Why Add a New Column to an Existing Data ExtensionDepending on your data storage needs, you might need to add additional information to a data extension in a column not currently included in that data extension. This procedure allows you to add additional information regarding your subscribers to an existing data extension without having to create a new data extension or transfer data into that data extension. How To Add a New Column to an Existing Data ExtensionUse the sample code below to create your own API calls to add the new column. Sample Java Code (Axis 1.4)public void testUpdateDataExtension() throws RemoteException {
Soap stub = init();
DataExtension dataExtension = new DataExtension();
dataExtension.setCustomerKey("CustomerKey");
DataExtensionField f = new DataExtensionField();
f.setName("HTMLContent");
f.setCustomerKey("HTMLContent_Key");
f.setMaxLength(new Integer(4000));
dataExtension.setFields(new DataExtensionField[]{f});
UpdateOptions updateOptions = new UpdateOptions();
SaveOption option = new SaveOption();
option.setPropertyName("DataExtension");
option.setSaveAction(SaveAction.UpdateOnly);
updateOptions.setSaveOptions(new SaveOption[]{option});
UpdateRequest updateRequest = new UpdateRequest(updateOptions, new APIObject[]{dataExtension});
UpdateResponse updateResponse = stub.update(updateRequest);
System.out.println("updateResponse :::: " + updateResponse.getOverallStatus());
}
Sample SOAP Envelope<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-5501096" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>XXX</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXX</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<UpdateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
<Options />
<Objects xsi:type="ns1:DataExtension" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">
<CustomerKey>8533EC32-5E12-4599-B279-0369EFCB38E3</CustomerKey>
<Fields>
<Field>
<Name>New Field</Name>
<MaxLength>200</MaxLength>
<IsRequired>true</IsRequired>
</Field>
</Fields>
</Objects>
</UpdateRequest>
</soapenv:Body>
</soapenv:Envelope>
This page was last updated by Ryan Williams on Fri, 06 Jan 2012 21:24:17 GMT. If you require assistance with the ExactTarget application, please contact Global Support. If you wish to send Ryan direct feedback, fill out the form below:
Tags: (Edit tags)
|
Powered by MindTouch 2010 |