Reference

Table FileReaderWriterCsv


Description

No description available

Supported Operations

Below section contains supported CRUD operations. Each operation is executed by some EndPoint behind the scene.
Method Supported Reference EndPoint
SELECT get_csv_file
INSERT create_csv_file
UPDATE create_csv_file
UPSERT
DELETE
LOOKUP

Examples

SSIS

Use OneDrive Connector in API Source component to read data or in API Destination component to read/write data:

Read from CSV File Read/Create/Update table using API Source

API Source - OneDrive
OneDrive Connector can be used to integrate OneDrive and your defined data source, e.g. Microsoft SQL, Oracle, Excel, Power BI, etc. Get, write, delete OneDrive data in a few clicks!
OneDrive
CSV File Read/Create/Update
Required Parameters
Drive Id / Shared Folder Fill-in the parameter...
File Id or Path (e.g. root:/somefolder/myfile.xyz: ) - Max 1000 Listed Fill-in the parameter...
ColumnDelimiter Fill-in the parameter...
HasColumnHeaderRow Fill-in the parameter...
FileCompressionType Fill-in the parameter...
Optional Parameters
Default Group or User Id (additional Scopes needed to list - If fails enter manually)
Search Type (For UI Only - Default=Recursive - i.e. Blank)
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed
DataFormat Notset
Continue On 404 Error (When item not found) True
Encoding
CharacterSet
EnableCustomReplace
SearchFor
ReplaceWith
ThrowErrorOnColumnCountMismatch
ThrowErrorOnNoRecordFound
AllowComment
SkipRows
SkipHeaderCommentRows
TreatBlankAsNull
IgnoreBlankLines
SkipEmptyRecords
TrimHeaders
TrimFields
DateFormatString
SSIS API Source - Read from table or endpoint

Read/write to CSV File Read/Create/Update table using API Destination

API Destination - OneDrive
OneDrive Connector can be used to integrate OneDrive and your defined data source, e.g. Microsoft SQL, Oracle, Excel, Power BI, etc. Get, write, delete OneDrive data in a few clicks!
OneDrive
CSV File Read/Create/Update
Select
Required Parameters
Drive Id / Shared Folder Fill-in the parameter...
File Id or Path (e.g. root:/somefolder/myfile.xyz: ) - Max 1000 Listed Fill-in the parameter...
ColumnDelimiter Fill-in the parameter...
HasColumnHeaderRow Fill-in the parameter...
FileCompressionType Fill-in the parameter...
Optional Parameters
Default Group or User Id (additional Scopes needed to list - If fails enter manually)
Search Type (For UI Only - Default=Recursive - i.e. Blank)
Search Folder (For UI Only - Helps to narrow down File Selection DropDown) - Max 200 Listed
DataFormat Notset
Continue On 404 Error (When item not found) True
Encoding
CharacterSet
EnableCustomReplace
SearchFor
ReplaceWith
ThrowErrorOnColumnCountMismatch
ThrowErrorOnNoRecordFound
AllowComment
SkipRows
SkipHeaderCommentRows
TreatBlankAsNull
IgnoreBlankLines
SkipEmptyRecords
TrimHeaders
TrimFields
DateFormatString
SSIS API Destination - Access table operation

ODBC application

Use these SQL queries in your ODBC application data source:

Create / Update a CSV File in OneDrive from External Data Source (e.g. MSSQL / ODBC)

This example shows how to create / update a CSV file directly on OneDrive using streaming approach. This example reads records from Microsoft SQL Server database and writes data to CSV file on OneDrive. If file does not exists then it creates a new one.

INSERT INTO FileReaderWriterCsv
SOURCE( 'MSSQL'--OR 'ODBC'
, 'Data Source=localhost;Initial Catalog=Northwind;Integrated Security=true'
, 'select OrderId,CustomerId,OrderDate FROM Northwind.dbo.Orders'
)
WITH(
	  DriveId='b!XpzQciaV_k6my5II5L22J0C4iRhyz21Js89PUyZ6-w0lH0AYv_I8RJHpXZQ81efD'
	  , FileId='root:/test_out.csv:'
	--, FileId='root:/subfolder/test_out.csv:'
	--, FileId='01N3NxxxxxxxWZYSDJ'  --exising File ID
	--, ContinueOn404Error=0 --Fail if file not found (Useful for overwrite mode for exising file)
	--, FileId='01N3NI7YU6DYBSLCEDKBB23CR4FSWZYSDJ'  --exising File ID for overwrite action
	--, ColumnDelimiter=',' --{LF}, {TAB}, | , \x0009 ...
	--, RowDelimiter='{NEWLINE}' --{LF}, {TAB}, | , \x0009 ...
	--, HasColumnHeaderRow=0 --set for header less file
    --, WriterDateTimeFormat='yyyy-MM-ddTHH:mm:ss.fff'  
    --See Query Builder for more options
)

SQL Server

Use these SQL queries in SQL Server after you create a data source in Data Gateway:

Create / Update a CSV File in OneDrive from External Data Source (e.g. MSSQL / ODBC)

This example shows how to create / update a CSV file directly on OneDrive using streaming approach. This example reads records from Microsoft SQL Server database and writes data to CSV file on OneDrive. If file does not exists then it creates a new one.

DECLARE @MyQuery NVARCHAR(MAX) = 'INSERT INTO FileReaderWriterCsv
SOURCE( ''MSSQL''--OR ''ODBC''
, ''Data Source=localhost;Initial Catalog=Northwind;Integrated Security=true''
, ''select OrderId,CustomerId,OrderDate FROM Northwind.dbo.Orders''
)
WITH(
	  DriveId=''b!XpzQciaV_k6my5II5L22J0C4iRhyz21Js89PUyZ6-w0lH0AYv_I8RJHpXZQ81efD''
	  , FileId=''root:/test_out.csv:''
	--, FileId=''root:/subfolder/test_out.csv:''
	--, FileId=''01N3NxxxxxxxWZYSDJ''  --exising File ID
	--, ContinueOn404Error=0 --Fail if file not found (Useful for overwrite mode for exising file)
	--, FileId=''01N3NI7YU6DYBSLCEDKBB23CR4FSWZYSDJ''  --exising File ID for overwrite action
	--, ColumnDelimiter='','' --{LF}, {TAB}, | , \x0009 ...
	--, RowDelimiter=''{NEWLINE}'' --{LF}, {TAB}, | , \x0009 ...
	--, HasColumnHeaderRow=0 --set for header less file
    --, WriterDateTimeFormat=''yyyy-MM-ddTHH:mm:ss.fff''  
    --See Query Builder for more options
)';

EXEC (@MyQuery) AT [LS_TO_ONEDRIVE_IN_GATEWAY];