Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Android Contacts – Update Company Name

Posted on February 21, 2014October 26, 2015 By David Kittell
UPDATE data
SET data1 = "<Company Name>"
WHERE mimetype_id IN (
		SELECT _id
		FROM mimetypes
		WHERE mimetype LIKE "%organization%"
		)
	AND data1 LIKE "%<Company Name>%";
UPDATE data
SET data1 = "<Company Name>"
WHERE mimetype_id IN (
		SELECT _id
		FROM mimetypes
		WHERE mimetype LIKE "%organization%"
		)
	AND raw_contact_id IN (
		SELECT raw_contact_id
		FROM data dt1
		INNER JOIN mimetypes ON mimetype_id = mimetypes._id
		WHERE mimetype LIKE "%email%"
			AND raw_contact_id IN (
				SELECT raw_contact_id
				FROM data dt1
				INNER JOIN mimetypes ON mimetype_id = mimetypes._id
				WHERE mimetype LIKE "%email%"
					AND data1 LIKE '%<Company Email Domain>%'
				)
		);
UPDATE data
SET data1 = "<Company Name>"
WHERE mimetype_id IN (
		SELECT _id
		FROM mimetypes
		WHERE mimetype LIKE "%organization%"
		)
	AND (
		data1 LIKE "%<Company Name>%"
		OR raw_contact_id IN (
			SELECT raw_contact_id
			FROM data dt1
			INNER JOIN mimetypes ON mimetype_id = mimetypes._id
			WHERE mimetype LIKE "%email%"
				AND raw_contact_id IN (
					SELECT raw_contact_id
					FROM data dt1
					INNER JOIN mimetypes ON mimetype_id = mimetypes._id
					WHERE mimetype LIKE "%email%"
						AND data1 LIKE '%<Company Email Domain>%'
					)
			)
		);
Originally Posted on February 21, 2014
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Android SQLite Code SQL SQLite

Post navigation

Previous post
Next post

Related Posts

PowerShell – Clear Temporary ASP.NET Files

Posted on October 13, 2019

If your Temporary ASP.NET Files directory is getting out of hand there are a few things you can do about it. First option I found was at https://sysadminspot.com/server-administration/powershell-cleanup-temp-asp-net-files/. Get-ChildItem “C:\Windows\Microsoft.NET\Framework*\v*\Temporary ASP.NET Files” -Recurse | Remove-Item -Recurse This option works well and in some cases could be the safer option as…

Read More

PowerShell – Download Azure Blob Container Content

Posted on September 6, 2017

You get all of your data into Azure or your application uploads/creates directly into Azure storage and then someone asks you to download the files…. This script below will help you download your files. $StartTime = $(get-date) $datetime = $(get-date -f yyyy-MM-dd_hh.mm.ss) $connection_string = ” $AzureBlobContainerName = ” $destination_path =…

Read More

Database Primary Key Max Entry Fix

Posted on February 28, 2013October 26, 2015

Two options with this fix, official script from Ektron or to fix the individual tables that are currently having the issue. CREATE PROCEDURE [dbo].[fixmaxentries] AS BEGIN UPDATE max_entries SET max_table_number = ( SELECT MAX(PreferenceId) + 2 FROM notification_preference ) WHERE table_name = ‘notification_preference’; UPDATE max_entries SET max_table_number = ( SELECT…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes