SSIS Components for QuickBooks Online

Build 20.0.7587

SELECT INTO ステートメント

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

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

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

C#

String connectionString = "InitiateOAuth=GETANDREFRESH;";

using (QuickBooksOnlineConnection connection = new QuickBooksOnlineConnection(connectionString)) {
  QuickBooksOnlineCommand cmd = new QuickBooksOnlineCommand("SELECT Id, GivenName INTO [csv://Customers.txt] FROM [Customers] WHERE GivenName = 'Cook, Brian' ", connection);
  int rowsAffected = cmd.ExecuteNonQuery();
} 

VB.NET

Dim connectionString As [String] = "InitiateOAuth=GETANDREFRESH;" 

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

C#

String connectionString = "InitiateOAuth=GETANDREFRESH;";

using (QuickBooksOnlineConnection connection = new QuickBooksOnlineConnection(connectionString)) {
  QuickBooksOnlineCommand cmd = new QuickBooksOnlineCommand("SELECT * INTO [Customers] IN [csv://filename=c:/Customers.csv;delimiter=tab] FROM [Customers] WHERE GivenName = 'Cook, Brian'", connection);
  int rowsAffected = cmd.ExecuteNonQuery();
} 

VB.NET

Dim connectionString As [String] = "InitiateOAuth=GETANDREFRESH;" 

Using connection As New QuickBooksOnlineConnection(connectionString)
  Dim cmd As New QuickBooksOnlineCommand("SELECT * INTO [Customers] IN [csv://filename=c:/Customers.csv;delimiter=tab] FROM [Customers] WHERE GivenName = 'Cook, Brian'", connection)
  Dim rowsAffected As Integer = cmd.ExecuteNonQuery()
End Using

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