CData ODBC Driver for QuickBase 2019J - Online Help

SELECT INTO ステートメント

CData ODBC Driver for QuickBase 2019J - Build 19.0.7445

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

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

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

SELECT Id, Column1 INTO [csv://SampleTable_1.txt] FROM [SampleTable_1] WHERE Column2 = 'Bob'
ファイルURI で他のフォーマットを指定できます。利用可能な区切り文字はタブ、セミコロン、カンマです。デフォルトはカンマです。次の例は、tab-separated values(TSV)にエクスポートします。
SELECT Id, Column1 INTO [csv://SampleTable_1.txt;delimiter=tab] FROM [SampleTable_1] WHERE Column2 = 'Bob'

C#

String connectionString = "User=test@email.com;Password=test_1234;Domain=test.quickbase.com;ApplicationToken='bwkxrb5da2wn57bzfh9xn24';";

using (QuickBaseConnection connection = new QuickBaseConnection(connectionString)) {
  QuickBaseCommand cmd = new QuickBaseCommand("SELECT Id, Column1 INTO [csv://SampleTable_1.txt] FROM [SampleTable_1] WHERE Column2 = 'Bob' ", connection);
  int rowsAffected = cmd.ExecuteNonQuery();
} 

VB.NET

Dim connectionString As [String] = "User=test@email.com;Password=test_1234;Domain=test.quickbase.com;ApplicationToken='bwkxrb5da2wn57bzfh9xn24';" 

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

C#

String connectionString = "User=test@email.com;Password=test_1234;Domain=test.quickbase.com;ApplicationToken='bwkxrb5da2wn57bzfh9xn24';";

using (QuickBaseConnection connection = new QuickBaseConnection(connectionString)) {
  QuickBaseCommand cmd = new QuickBaseCommand("SELECT * INTO [SampleTable_1] IN [csv://filename=c:/SampleTable_1.csv;delimiter=tab] FROM [SampleTable_1] WHERE Column2 = 'Bob'", connection);
  int rowsAffected = cmd.ExecuteNonQuery();
} 

VB.NET

Dim connectionString As [String] = "User=test@email.com;Password=test_1234;Domain=test.quickbase.com;ApplicationToken='bwkxrb5da2wn57bzfh9xn24';" 

Using connection As New QuickBaseConnection(connectionString)
  Dim cmd As New QuickBaseCommand("SELECT * INTO [SampleTable_1] IN [csv://filename=c:/SampleTable_1.csv;delimiter=tab] FROM [SampleTable_1] WHERE Column2 = 'Bob'", connection)
  Dim rowsAffected As Integer = cmd.ExecuteNonQuery()
End Using

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