CData BizTalk Adapter for FedEx 2019 - Online Help
Questions / Feedback?

SELECT INTO Statements

CData BizTalk Adapter for FedEx 2019 - Build 19.0.7354

You can use the SELECT INTO statement to export formatted data to a file.

Data Export with an SQL Query

The following query exports data into a file formatted in comma-separated values (CSV):

SELECT FirstName, Phone INTO [csv://Senders.txt] FROM [Senders] WHERE SenderID = '25'
You can specify other formats in the file URI. The possible delimiters are tab, semicolon, and comma with the default being a comma. The following example exports tab-separated values:
SELECT FirstName, Phone INTO [csv://Senders.txt;delimiter=tab] FROM [Senders] WHERE SenderID = '25'

C#

String connectionString = "Server='https://gatewaybeta.fedex.com:443/xml';DeveloperKey='alsdkfjpqoewiru';Password='zxczxqqtyiuowkdlkn';AccountNumber='110371337';MeterNumber='240134349';
PrintLabelLocation='C:\users\username\documents\mylabels';CacheLocation='C:\users\username\documents\fedexcache';";

using (FedExConnection connection = new FedExConnection(connectionString)) {
  FedExCommand cmd = new FedExCommand("SELECT FirstName, Phone INTO [csv://Senders.txt] FROM [Senders] WHERE SenderID = '25' ", connection);
  int rowsAffected = cmd.ExecuteNonQuery();
} 

VB.NET

Dim connectionString As [String] = "Server='https://gatewaybeta.fedex.com:443/xml';DeveloperKey='alsdkfjpqoewiru';Password='zxczxqqtyiuowkdlkn';AccountNumber='110371337';MeterNumber='240134349';
PrintLabelLocation='C:\users\username\documents\mylabels';CacheLocation='C:\users\username\documents\fedexcache';" 

Using connection As New FedExConnection(connectionString)
  Dim cmd As New FedExCommand("SELECT FirstName, Phone INTO [csv://Senders.txt] FROM [Senders] WHERE SenderID = '25'", connection)
  Dim rowsAffected As Integer = cmd.ExecuteNonQuery()
End Using
You can specify other file formats in the URI. The following example exports tab-separated values:

C#

String connectionString = "Server='https://gatewaybeta.fedex.com:443/xml';DeveloperKey='alsdkfjpqoewiru';Password='zxczxqqtyiuowkdlkn';AccountNumber='110371337';MeterNumber='240134349';
PrintLabelLocation='C:\users\username\documents\mylabels';CacheLocation='C:\users\username\documents\fedexcache';";

using (FedExConnection connection = new FedExConnection(connectionString)) {
  FedExCommand cmd = new FedExCommand("SELECT * INTO [Senders] IN [csv://filename=c:/Senders.csv;delimiter=tab] FROM [Senders] WHERE SenderID = '25'", connection);
  int rowsAffected = cmd.ExecuteNonQuery();
} 

VB.NET

Dim connectionString As [String] = "Server='https://gatewaybeta.fedex.com:443/xml';DeveloperKey='alsdkfjpqoewiru';Password='zxczxqqtyiuowkdlkn';AccountNumber='110371337';MeterNumber='240134349';
PrintLabelLocation='C:\users\username\documents\mylabels';CacheLocation='C:\users\username\documents\fedexcache';" 

Using connection As New FedExConnection(connectionString)
  Dim cmd As New FedExCommand("SELECT * INTO [Senders] IN [csv://filename=c:/Senders.csv;delimiter=tab] FROM [Senders] WHERE SenderID = '25'", connection)
  Dim rowsAffected As Integer = cmd.ExecuteNonQuery()
End Using

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