CData SSIS Components for Amazon S3 2019J - Online Help

SELECT INTO ステートメント

CData SSIS Components for Amazon S3 2019J - Build 19.0.7362

SELECT INTO ステートメントを使って、書式付きデータをファイルにエクスポートできます。

SQL クエリを使ったデータのエクスポート

次のクエリは、comma-separated values(CSV)ファイルフォーマットにデータをエクスポートします。

C#

String connectionString = "AccessKey=a123;SecretKey=s123;";

using (AmazonS3Connection connection = new AmazonS3Connection(connectionString)) {
  AmazonS3Command cmd = new AmazonS3Command("SELECT Name, OwnerId INTO [csv://Buckets.txt] FROM [Buckets] WHERE Name = 'TestBucket' ", connection);
  int rowsAffected = cmd.ExecuteNonQuery();
} 

VB.NET

Dim connectionString As [String] = "AccessKey=a123;SecretKey=s123;" 

Using connection As New AmazonS3Connection(connectionString)
  Dim cmd As New AmazonS3Command("SELECT Name, OwnerId INTO [csv://Buckets.txt] FROM [Buckets] WHERE Name = 'TestBucket'", connection)
  Dim rowsAffected As Integer = cmd.ExecuteNonQuery()
End Using
URI で他のファイルフォーマットを指定できます。以下の例は、tab-separated values(TSV)にエクスポートします。

C#

String connectionString = "AccessKey=a123;SecretKey=s123;";

using (AmazonS3Connection connection = new AmazonS3Connection(connectionString)) {
  AmazonS3Command cmd = new AmazonS3Command("SELECT * INTO [Buckets] IN [csv://filename=c:/Buckets.csv;delimiter=tab] FROM [Buckets] WHERE Name = 'TestBucket'", connection);
  int rowsAffected = cmd.ExecuteNonQuery();
} 

VB.NET

Dim connectionString As [String] = "AccessKey=a123;SecretKey=s123;" 

Using connection As New AmazonS3Connection(connectionString)
  Dim cmd As New AmazonS3Command("SELECT * INTO [Buckets] IN [csv://filename=c:/Buckets.csv;delimiter=tab] FROM [Buckets] WHERE Name = 'TestBucket'", connection)
  Dim rowsAffected As Integer = cmd.ExecuteNonQuery()
End Using

 
 
Copyright (c) 2020 CData Software, Inc. - All rights reserved.
Build 19.0.7362.0