<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.starfishetl.com/index.php?action=history&amp;feed=atom&amp;title=Check_for_duplicates_using_xref</id>
	<title>Check for duplicates using xref - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.starfishetl.com/index.php?action=history&amp;feed=atom&amp;title=Check_for_duplicates_using_xref"/>
	<link rel="alternate" type="text/html" href="https://wiki.starfishetl.com/index.php?title=Check_for_duplicates_using_xref&amp;action=history"/>
	<updated>2026-04-16T08:16:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.2</generator>
	<entry>
		<id>https://wiki.starfishetl.com/index.php?title=Check_for_duplicates_using_xref&amp;diff=4874&amp;oldid=prev</id>
		<title>Jkuehlthau at 19:09, 10 September 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.starfishetl.com/index.php?title=Check_for_duplicates_using_xref&amp;diff=4874&amp;oldid=prev"/>
		<updated>2015-09-10T19:09:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:09, 10 September 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;I needed to check for duplicate attachments in a system and remove the duplicates.  I created a Job that used the same origin and destination and pulled all records from the Attachments table.  I had a before operation that would read and write to the same xref list, thanks to the use of the newer SQLite xref list functionality, http://wiki.starfishetl.com/index.php/Cross-reference_(Xref)#SQLite_Xref.  In this code, I check to see if the record I&#039;m reading already exists in the XREF.  If it exists, then I know it is a duplicate and can proceed to the Delete Stage.  If it is not a duplicate&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, then &lt;/del&gt;I write the data to the XREF and skip the Delete Stage.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;I needed to check for duplicate attachments in a system and remove the duplicates.  I created a Job that used the same origin and destination and pulled all records from the Attachments table.  I had a before operation that would read and write to the same xref list, thanks to the use of the newer SQLite xref list functionality, http://wiki.starfishetl.com/index.php/Cross-reference_(Xref)#SQLite_Xref.  In this code, I check to see if the record I&#039;m reading already exists in the XREF.  If it exists, then I know it is a duplicate and can proceed to the Delete Stage.  If &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;it does not exist, then &lt;/ins&gt;it is not a duplicate &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;and &lt;/ins&gt;I write the data to the XREF and skip the Delete Stage.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sub VBScriptProcedure&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sub VBScriptProcedure&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Jkuehlthau</name></author>
	</entry>
	<entry>
		<id>https://wiki.starfishetl.com/index.php?title=Check_for_duplicates_using_xref&amp;diff=4873&amp;oldid=prev</id>
		<title>Jkuehlthau: Created page with &quot;I needed to check for duplicate attachments in a system and remove the duplicates.  I created a Job that used the same origin and destination and pulled all records from the A...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.starfishetl.com/index.php?title=Check_for_duplicates_using_xref&amp;diff=4873&amp;oldid=prev"/>
		<updated>2015-09-10T19:09:01Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;I needed to check for duplicate attachments in a system and remove the duplicates.  I created a Job that used the same origin and destination and pulled all records from the A...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;I needed to check for duplicate attachments in a system and remove the duplicates.  I created a Job that used the same origin and destination and pulled all records from the Attachments table.  I had a before operation that would read and write to the same xref list, thanks to the use of the newer SQLite xref list functionality, http://wiki.starfishetl.com/index.php/Cross-reference_(Xref)#SQLite_Xref.  In this code, I check to see if the record I&amp;#039;m reading already exists in the XREF.  If it exists, then I know it is a duplicate and can proceed to the Delete Stage.  If it is not a duplicate, then I write the data to the XREF and skip the Delete Stage.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
Sub VBScriptProcedure&lt;br /&gt;
	dim strExists&lt;br /&gt;
	strExists = xrefread(&amp;quot;sf-attachments&amp;quot;,&amp;quot;@@ORG:ParentId@@@@ORG:NAME@@&amp;quot;)&lt;br /&gt;
	If strExists = &amp;quot;Exists&amp;quot; Then&lt;br /&gt;
		LogMessage &amp;quot;Duplicate of: @@ORG:NAME@@&amp;quot;&lt;br /&gt;
	Else&lt;br /&gt;
		XrefWrite &amp;quot;sf-attachments&amp;quot;,&amp;quot;@@ORG:ParentId@@@@ORG:NAME@@&amp;quot;,&amp;quot;Exists&amp;quot;&lt;br /&gt;
		GoToNextRow&lt;br /&gt;
	End if&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jkuehlthau</name></author>
	</entry>
</feed>