SSIS Components for Twilio

Build 21.0.7871

SELECT INTO ステートメント

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

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

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

C#

String connectionString = "AccountSid=MyAccountSid;AuthToken=MyAuthToken;";

using (TwilioConnection connection = new TwilioConnection(connectionString)) {
  TwilioCommand cmd = new TwilioCommand("SELECT Sid, Name INTO [csv://Applications.txt] FROM [Applications] WHERE Sid = 'AP5ddf534702934bd3a446d293e8cdeb1f' ", connection);
  int rowsAffected = cmd.ExecuteNonQuery();
} 

VB.NET

Dim connectionString As [String] = "AccountSid=MyAccountSid;AuthToken=MyAuthToken;" 

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

C#

String connectionString = "AccountSid=MyAccountSid;AuthToken=MyAuthToken;";

using (TwilioConnection connection = new TwilioConnection(connectionString)) {
  TwilioCommand cmd = new TwilioCommand("SELECT * INTO [Applications] IN [csv://filename=c:/Applications.csv;delimiter=tab] FROM [Applications] WHERE Sid = 'AP5ddf534702934bd3a446d293e8cdeb1f'", connection);
  int rowsAffected = cmd.ExecuteNonQuery();
} 

VB.NET

Dim connectionString As [String] = "AccountSid=MyAccountSid;AuthToken=MyAuthToken;" 

Using connection As New TwilioConnection(connectionString)
  Dim cmd As New TwilioCommand("SELECT * INTO [Applications] IN [csv://filename=c:/Applications.csv;delimiter=tab] FROM [Applications] WHERE Sid = 'AP5ddf534702934bd3a446d293e8cdeb1f'", connection)
  Dim rowsAffected As Integer = cmd.ExecuteNonQuery()
End Using

Copyright (c) 2021 CData Software, Inc. - All rights reserved.
Build 21.0.7871