GETDELETED Statements
You can issue the GETDELETED query to retrieve all records deleted from the live data for the time range specified. This query accepts a datetime value as a filter, as shown in the following example:
GETDELETED FROM <table_name> WHERE <search_condition>
<search_condition> ::=
{
<expression> { = | < | <= | > | >= } [ <expression> ]
} [ { AND | OR } ... ]
<expression> ::=
| @ <parameter>
| ?
| <literal>
C#
String connectionString = "[email protected];Password=test_1234;Domain=test.quickbase.com;ApplicationToken='bwkxrb5da2wn57bzfh9xn24';"; using (QuickBaseConnection connection = new QuickBaseConnection(connectionString)) { QuickBaseCommand cmd = new QuickBaseCommand("GETDELETED FROM [CData].[QuickBase].SampleTable_1 WHERE Date_Modified >= '2013-01-01'", connection); QuickBaseDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { Console.WriteLine(rdr["Id"].ToString()); } }
VB.NET
Dim connectionString As [String] = "[email protected];Password=test_1234;Domain=test.quickbase.com;ApplicationToken='bwkxrb5da2wn57bzfh9xn24';" Using connection As New QuickBaseConnection(connectionString) Dim cmd As New QuickBaseCommand("GETDELETED FROM [CData].[QuickBase].SampleTable_1 WHERE Date_Modified >= '2013-01-01'", connection) Dim rdr As QuickBaseDataReader = cmd.ExecuteReader() While rdr.Read() Console.WriteLine(rdr("Id").ToString()) End While End UsingNote: By putting a CACHE command in front of the query, you can update the cache to remove all values that have been deleted from the data source, as shown in the following example:
CACHE GETDELETED FROM [TableName] WHERE Date_Modified >= '2013-01-01' AND Date_Modified <= '2013-02-01'