SSIS Components for au PAY Market

Build 22.0.8509

SELECT INTO ステートメント

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

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

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

C#

String connectionString = "ApiKey=MyApiKey;ShopId=MyShopId;";

using (auPAYMarketConnection connection = new auPAYMarketConnection(connectionString)) {
  auPAYMarketCommand cmd = new auPAYMarketCommand("SELECT ItemCode, LotNumber INTO [csv://Items.txt] FROM [Items] WHERE LotNumber = '12345' ", connection);
  int rowsAffected = cmd.ExecuteNonQuery();
} 

VB.NET

Dim connectionString As [String] = "ApiKey=MyApiKey;ShopId=MyShopId;" 

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

C#

String connectionString = "ApiKey=MyApiKey;ShopId=MyShopId;";

using (auPAYMarketConnection connection = new auPAYMarketConnection(connectionString)) {
  auPAYMarketCommand cmd = new auPAYMarketCommand("SELECT * INTO [Items] IN [csv://filename=c:/Items.csv;delimiter=tab] FROM [Items] WHERE LotNumber = '12345'", connection);
  int rowsAffected = cmd.ExecuteNonQuery();
} 

VB.NET

Dim connectionString As [String] = "ApiKey=MyApiKey;ShopId=MyShopId;" 

Using connection As New auPAYMarketConnection(connectionString)
  Dim cmd As New auPAYMarketCommand("SELECT * INTO [Items] IN [csv://filename=c:/Items.csv;delimiter=tab] FROM [Items] WHERE LotNumber = '12345'", connection)
  Dim rowsAffected As Integer = cmd.ExecuteNonQuery()
End Using

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8509