ADO.NET Provider for Reckon Accounts Hosted

Build 24.0.9062

GETDELETED ステートメント

GETDELETED クエリを発行して、指定した期間内にライブデータから削除されたすべてのレコードを取得できます。このクエリは、次の例に示すように、フィルタとしてdatetime 値を許容します。

GETDELETED FROM <table_name> WHERE <search_condition>

<search_condition> ::= 
  {
    <expression> { = | < | <= | > | >= } [ <expression> ] 
  } [ { AND | OR } ... ]

<expression> ::=
  | @ <parameter> 
  | ?
  | <literal>
  

C#

String connectionString = "SubscriptionKey=test;CountryVersion=2021.R2.AU;CompanyFile=Q:/CData Software.QBW;User=test;Password=test;InitiateOAuth=GETANDREFRESH;CallbackURL=http://localhost:33333;OAuthClientId=MyOAuthClientID;OAuthClientSecret=MyOAuthClientSecret;";
using (ReckonAccountsHostedConnection connection = new ReckonAccountsHostedConnection(connectionString)) {
  ReckonAccountsHostedCommand cmd = new ReckonAccountsHostedCommand("GETDELETED FROM Customers WHERE TimeModified >= '2013-01-01'", connection); 
  ReckonAccountsHostedDataReader rdr = cmd.ExecuteReader();
  while (rdr.Read()) {
    Console.WriteLine(rdr["Id"].ToString());
  }
}

VB.NET

Dim connectionString As [String] = "SubscriptionKey=test;CountryVersion=2021.R2.AU;CompanyFile=Q:/CData Software.QBW;User=test;Password=test;InitiateOAuth=GETANDREFRESH;CallbackURL=http://localhost:33333;OAuthClientId=MyOAuthClientID;OAuthClientSecret=MyOAuthClientSecret;"
Using connection As New ReckonAccountsHostedConnection(connectionString)
  Dim cmd As New ReckonAccountsHostedCommand("GETDELETED FROM Customers WHERE TimeModified >= '2013-01-01'", connection)
  Dim rdr As ReckonAccountsHostedDataReader = cmd.ExecuteReader()
  While rdr.Read()
    Console.WriteLine(rdr("Id").ToString())
  End While
End Using
Note:次の例に示すように、クエリの前にCACHE コマンドを入れてキャッシュを更新することで、データソースから削除されているすべての値をキャッシュから削除できます。
CACHE GETDELETED FROM [TableName] WHERE TimeModified >= '2013-01-01' AND TimeModified <= '2013-02-01'

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9062