Data.Cloud.AmazonAPI.TAmazonTableService

From RAD Studio API Documentation
Jump to: navigation, search

Data.Cloud.AmazonAPI.TAmazonBasicServiceData.Cloud.AmazonAPI.TAmazonServiceData.Cloud.CloudAPI.TCloudServiceSystem.TObjectTAmazonTableService
[–] Properties
Type: class
Visibility: public
Source:
Data.Cloud.AmazonAPI.pas
Data.Cloud.AmazonAPI.hpp
Unit: Data.Cloud.AmazonAPI
Parent: Data.Cloud.AmazonAPI

Delphi

TAmazonTableService =  class(TAmazonBasicService)

C++

class PASCALIMPLEMENTATION TAmazonTableService : public TAmazonBasicService

Description

Allows you to connect to the Amazon SimpleDB service.

This class provides methods that you can use to:

Additionally, TAmazonTableService provides some methods that return the response in an XML-parsed format:

For more information about the Amazon SimpleDB API, see the official Amazon SimpleDB Documentation.

Note: The official Amazon documentation refers to Tables as Domains, Rows as Items and Columns as Attributes.

The following code snippet demonstrates how to create a new table using the TAmazonTableService API:

Delphi:

var
  ResponseInfo: TCloudResponseInfo;
  TableService: TAmazonTableService;
  TableName:String;
begin
  TableName := 'TableName';
  TableService := TAmazonTableService.Create(AmazonConnectionInfo1);
  ResponseInfo := TCloudResponseInfo.Create;
  try
    if TableService.CreateTable(TableName, ResponseInfo) then
      Memo1.Lines.Append('Success! Table: ' + TableName + ' created.')
    else
      Memo1.Lines.Append(Format('Failure! %s', [ResponseInfo.StatusMessage]));
  finally
    TableService.Free;
    ResponseInfo.Free;
  end;
end;

C++:

TCloudResponseInfo *ResponseInfo;
String TableName;
TAmazonTableService *TableService;
TableName = "TableName";
TableService = new TAmazonTableService(AmazonConnectionInfo1);
ResponseInfo = new TCloudResponseInfo;
try
{
  if (TableService->CreateTable(TableName, ResponseInfo))
  {
    Memo1->Lines->Append("Success! Table: " + TableName + " created.");
  }
  else
  {
    TVarRec args[1] = {ResponseInfo->StatusMessage};
    Memo1->Lines->Append(Format("Failure! %s", args, 0));
  }
}
__finally
{
  delete TableService;
  delete ResponseInfo;
}

See Also