ADO.NET Provider for FinancialForce

Build 21.0.7929

GETDELETED ステートメント

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

GETDELETED FROM <table_name> WHERE <search_condition>

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

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

C#

String connectionString = "User=myUser;Password=myPassword;Security Token=myToken;";
using (FinancialForceConnection connection = new FinancialForceConnection(connectionString)) {
  FinancialForceCommand cmd = new FinancialForceCommand("GETDELETED FROM Account WHERE TimeModified >='2013-01-01' AND TimeModified <='2013-02-01'", connection); 
  FinancialForceDataReader rdr = cmd.ExecuteReader();
  while (rdr.Read()) {
    Console.WriteLine(rdr["Id"].ToString());
  }
}

VB.NET

Dim connectionString As [String] = "User=myUser;Password=myPassword;Security Token=myToken;"
Using connection As New FinancialForceConnection(connectionString)
  Dim cmd As New FinancialForceCommand("GETDELETED FROM Account WHERE TimeModified >='2013-01-01' AND TimeModified <='2013-02-01'", connection)
  Dim rdr As FinancialForceDataReader = 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) 2021 CData Software, Inc. - All rights reserved.
Build 21.0.7929