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

Create / Delete SQLite Database Indexes

Posted on September 27, 2013December 30, 2015 By David Kittell
'Create Index
Sub CreateIndex(SQL As SQL, TableName As String, IndexName As String, Fields As String, Unique As Boolean)
   Dim query, uni As String
   uni = ""
   If Unique=True Then uni = "UNIQUE"
   query = "CREATE " & uni & " INDEX IF NOT EXISTS " & IndexName & " ON [" & TableName & "] (" & Fields & ")"
   Log("CreateIndex: " & query)
   SQL.ExecNonQuery(query)
End Sub
'Delete Index
Sub DropIndex(SQL As SQL, IndexName As String)
   Dim query As String
   query = "DROP INDEX IF EXISTS " & IndexName
   Log("DropIndex: " & query)
   SQL.ExecNonQuery(query)
End Sub

Source: Billy047 @ http://www.basic4ppc.com/android/forum/threads/dbutils-android-databases-are-now-simple.8475/page-2

Originally Posted on September 27, 2013
Last Updated on December 30, 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

Basic4Android Code SQL SQLite

Post navigation

Previous post
Next post

Related Posts

Change Text Case

Posted on February 22, 2013February 8, 2016

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Globalization; using System.Threading; namespace ChangeTextCase { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void btnCopy_Click(object sender, EventArgs e) { txtDestination.SelectAll(); txtDestination.Copy(); } private void btnChangeCase_Click(object sender, EventArgs e) {…

Read More

MySQL – Get Max Length of Column

Posted on October 29, 2015October 29, 2015

Similar to Max Length of Data In Column – MSSQL this query will do the same for MySQL Replace host (column) along with hosts (table) with what you’d like to check SELECT host ,LENGTH(host) AS mlen FROM hosts ORDER BY mlen DESC All information on this site is shared with…

Read More

Red Hat / CentOS / Fedora – Create Jailed SFTP User

Posted on December 26, 2017

If you are working on a project and need SFTP capabilities but don’t want users to see each other’s files create a SFTP Jailed server. Assumptions for the code below is that you are running Red Hat, CentOS, or Fedora and already have the OS running. NOTE: In this first…

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
 

Loading Comments...
 

You must be logged in to post a comment.