Best code examples for SQLiteDatabase execSQL method (android.database.sqlite.SQLiteDatabase.execSQL)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for SQLiteDatabase execSQL method.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

SQLiteDatabase execSQL examples from Open Source projects
This code example shows how to use the following methods: execSQL
49:	db.execSQL("CREATE TABLE orgs (id INTEGER PRIMARY KEY);"); 
50:	db.execSQL("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, avatarurl TEXT);"); 
51:	db.execSQL("CREATE TABLE repos (id INTEGER PRIMARY KEY, repoId INTEGER, orgId INTEGER, name TEXT, ownerId INTEGER, private INTEGER, fork INTEGER, description TEXT, forks INTEGER, watchers INTEGER, language TEXT, hasIssues INTEGER, mirrorUrl TEXT);"); 
-
57:	db.execSQL("DROP TABLE IF EXISTS orgs"); 
58:	db.execSQL("DROP TABLE IF EXISTS users"); 
59:	db.execSQL("DROP TABLE IF EXISTS repos"); 
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: delete, execSQL, rawQuery
448:	database.delete("exectable", null, null); 
-
450:	Cursor cursor = database.rawQuery("select * from exectable", null); 
-
454:	database.execSQL("insert into exectable (first_column) values (?);", new String[]{}); 
455:	Cursor cursor2 = database.rawQuery("select * from exectable", new String[]{null}); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: execSQL, setVersion
62:	db.execSQL(queryBuilder.toString()); 
63:	db.setVersion(DB_VERSION); 
-
72:	db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: execSQL, insert
69:	userDao.save(sqLiteDatabase, account.getUser()); 
-
76:	clearDeletedAccount(sqLiteDatabase, account); // 确保一个帐号在数据库中只有一条记录,一个状态 
-
78:	long rowId = sqLiteDatabase.insert(TABLE, null, values); 
-
94:	sqLiteDatabase.execSQL(sql.toString()); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: execSQL
133:	db.execSQL(FEED_SQL); 
134:	db.execSQL(SOCIAL_FEED_SQL); 
135:	db.execSQL(FOLDER_SQL); 
136:	db.execSQL(USER_SQL); 
137:	db.execSQL(STORY_SQL); 
138:	db.execSQL(COMMENT_SQL); 
139:	db.execSQL(REPLY_SQL); 
140:	db.execSQL(CLASSIFIER_SQL); 
141:	db.execSQL(FEED_FOLDER_SQL); 
142:	db.execSQL(SOCIALFEED_STORIES_SQL); 
143:	db.execSQL(OFFLINE_UPDATE_SQL); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: execSQL
75:	db.execSQL(CREATE_BOOKMARKS_TABLE); 
76:	db.execSQL(CREATE_TAGS_TABLE); 
77:	db.execSQL(CREATE_BOOKMARK_TAG_TABLE); 
78:	db.execSQL(BOOKMARK_TAGS_INDEX); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL
206:	db.execSQL(CREATE_ACCOUNT_TABLE_SQL); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL
282:	sqLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS " + KEYVAL_TABLE_NAME + "(" + 
-
286:	sqLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS " + GOOGLE_MANAGED_ITEMS_TABLE_NAME + "(" + 
-
289:	sqLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS " + VIRTUAL_CURRENCY_TABLE_NAME + "(" + 
-
293:	sqLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS " + VIRTUAL_GOODS_TABLE_NAME + "(" + 
-
298:	sqLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS " + METADATA_TABLE_NAME + "(" + 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL
202:	db.execSQL("DROP TABLE IF EXISTS "+TABLE_TM_NAME); 
203:	db.execSQL("DROP TABLE IF EXISTS "+GOODS_CATEGORY_TM_NAME); 
204:	db.execSQL("DROP TABLE IF EXISTS "+GOODS_TM_NAME); 
205:	db.execSQL("DROP TABLE IF EXISTS "+ELE_CART_TM_NAME); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL, rawQuery
80:	Cursor res = database.rawQuery("select name from sqlite_master where type = 'table' and name = 'dict_tbl'", null); 
-
86:	database.execSQL("insert into cards (ordinal, question, answer, note)" + 
-
92:	Cursor result = database.rawQuery("SELECT _id FROM dict_tbl", null); 
-
95:	result = database.rawQuery("SELECT _id FROM learn_tbl", null); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: execSQL
39:	db.execSQL(q.getExecutableSql()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: compileStatement, execSQL
44:	db.execSQL("delete from xor"); 
-
46:	SQLiteStatement insertStmt = db.compileStatement("INSERT INTO xor(in1,in2,ideal1) VALUES(0,0,0)"); 
-
48:	insertStmt = db.compileStatement("INSERT INTO xor(in1,in2,ideal1) VALUES(1,0,1)"); 
-
50:	insertStmt = db.compileStatement("INSERT INTO xor(in1,in2,ideal1) VALUES(0,1,1)"); 
-
52:	insertStmt = db.compileStatement("INSERT INTO xor(in1,in2,ideal1) VALUES(1,1,0)"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL, insert
84:	db.execSQL( 
-
95:	db.execSQL("CREATE INDEX lookup_identity ON identity(" + 
-
98:	db.execSQL( 
-
106:	db.execSQL("CREATE INDEX lookup_feature ON feature(" + 
-
114:	db.insert("identity", "_id", values); 
-
120:	db.insert("feature", "_id", values); 
-
122:	db.insert("feature", "_id", values); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: beginTransaction, endTransaction, execSQL, setTransactionSuccessful
21:	db.beginTransaction(); 
-
23:	db.execSQL(DbConstants.CREATE_IMAGE_SDCARD_CACHE_TABLE_SQL.toString()); 
24:	db.execSQL(DbConstants.CREATE_IMAGE_SDCARD_CACHE_TABLE_INDEX_SQL.toString()); 
-
26:	db.execSQL(DbConstants.CREATE_HTTP_CACHE_TABLE_SQL.toString()); 
27:	db.execSQL(DbConstants.CREATE_HTTP_CACHE_TABLE_INDEX_SQL.toString()); 
28:	db.execSQL(DbConstants.CREATE_HTTP_CACHE_TABLE_UNIQUE_INDEX.toString()); 
29:	db.setTransactionSuccessful(); 
-
31:	db.endTransaction(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL, setVersion
101:	db.execSQL(PROFILES_TABLE_UPGRADE_6_7_1); 
102:	db.execSQL(PROFILES_TABLE_UPGRADE_6_7_2); 
103:	db.execSQL(PROFILES_TABLE_UPGRADE_6_7_3); 
104:	db.execSQL(PROFILES_TABLE_UPGRADE_6_7_4); 
-
114:	db.execSQL(PROFILES_TABLE_UPGRADE_3_4); 
115:	db.execSQL(PROFILES_TABLE_UPGRADE_4_5); 
116:	db.execSQL(PROFILES_TABLE_UPGRADE_5_6); 
-
118:	db.setVersion(DATABASE_VERSION); 
-
120:	db.execSQL(PROFILES_TABLE_UPGRADE_3_4); 
121:	db.execSQL(PROFILES_TABLE_UPGRADE_4_5); 
122:	db.execSQL(PROFILES_TABLE_UPGRADE_5_6); 
-
124:	db.setVersion(DATABASE_VERSION); 
-
126:	db.execSQL(PROFILES_TABLE_UPGRADE_4_5); 
127:	db.execSQL(PROFILES_TABLE_UPGRADE_5_6); 
-
129:	db.setVersion(DATABASE_VERSION); 
-
131:	db.execSQL(PROFILES_TABLE_UPGRADE_5_6); 
-
133:	db.setVersion(DATABASE_VERSION); 
-
136:	db.setVersion(DATABASE_VERSION); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL
183:	db.execSQL(CREATE_TABLE); 
184:	db.execSQL(CREATE_INDEX); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL, insert, query
95:	Cursor c = 
-
136:	db.execSQL(DBVERSION_CREATE); 
-
139:	db.insert(TABLE_DBVERSION, null, args); 
-
141:	db.execSQL(TABLE_CREATE); 
-
158:	db.insert(TABLE_DBVERSION, null, args); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL
83:	db.execSQL(sql); 
-
98:	db.execSQL(sql); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL, insert
84:	db.execSQL( 
-
95:	db.execSQL("CREATE INDEX lookup_identity ON identity(" + 
-
98:	db.execSQL( 
-
106:	db.execSQL("CREATE INDEX lookup_feature ON feature(" + 
-
114:	db.insert("identity", "_id", values); 
-
120:	db.insert("feature", "_id", values); 
-
122:	db.insert("feature", "_id", values); 
-
137:	db.execSQL("DROP TABLE feature"); 
138:	db.execSQL("DROP TABLE identity"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: beginTransaction, endTransaction, execSQL, isReadOnly, setTransactionSuccessful
43:	if(!db.isReadOnly()){ 
-
46:	db.execSQL("create table if not exists bookmark(" 
-
56:	db.execSQL("create table if not exists tmpdir(" 
-
65:	db.beginTransaction(); 
-
67:	db.setTransactionSuccessful(); 
-
69:	db.endTransaction(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: execSQL
99:	db.execSQL("Some SQL"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL, rawQuery
23:	droidsniffDB.execSQL(CREATE_PREFERENCES); 
24:	droidsniffDB.execSQL(CREATE_BLACKLIST); 
-
65:	Cursor cur = droidsniffDB.rawQuery("SELECT count(id) as count FROM DROIDSNIFF_PREFERENCES where name = 'generic';", 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: execSQL, update
200:	db.execSQL(addColumnSql); 
201:	db.execSQL(addParentAccountSql); 
-
209:	db.update(ACCOUNTS_TABLE_NAME, cv, null, null); 
-
216:	db.execSQL(addPlaceHolderAccountFlagSql); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: execSQL, setVersion
62:	db.execSQL(queryBuilder.toString()); 
63:	db.setVersion(DB_VERSION); 
-
72:	db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL, insert, query
114:	Cursor c = 
-
160:	db.execSQL(DBVERSION_CREATE); 
-
163:	db.insert(TABLE_DBVERSION, null, args); 
-
165:	db.execSQL(TABLE_LOG_CREATE); 
166:	db.execSQL(TABLE_CELL_CREATE); 
167:	db.execSQL(TABLE_TAGS_CREATE); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: beginTransactionWithListener, endTransaction, execSQL
93:	mDb.execSQL("PRAGMA cache_size=6000"); 
94:	mDb.execSQL("PRAGMA synchronous=OFF"); 
95:	mDb.execSQL("PRAGMA count_changes=OFF"); 
96:	mDb.beginTransactionWithListener(this); 
-
104:	mDb.endTransaction(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: execSQL
40:	db.execSQL(sqlScreenSettings); 
-
53:	db.execSQL(sqlPerformanceFlags); 
-
82:	db.execSQL(sqlManualBookmarks); 
-
94:	db.execSQL(sqlInsertDefaultScreenEntry); 
95:	db.execSQL(sqlInsertDefaultScreenEntry); 
-
108:	db.execSQL(sqlInsertDefaultPerfFlags); 
109:	db.execSQL(sqlInsertDefaultPerfFlags); 
-
135:	db.execSQL(sqlInsertDefaultSessionEntry); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL
30:	db.execSQL("CREATE TABLE pending_incoming_messages (" 
-
41:	db.execSQL("CREATE TABLE pending_outgoing_messages (" 
-
54:	db.execSQL("DROP TABLE IF EXISTS pending_incoming_messages"); 
55:	db.execSQL("DROP TABLE IF EXISTS pending_outgoing_messages"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL, rawQuery
357:	mBadDb.execSQL("INSERT INTO Events (_id,dtstart,dtend,duration,dtstart2,dtend2," + 
-
370:	mBadDb.execSQL("INSERT INTO Events (_id,dtstart,dtend,duration,dtstart2,dtend2," + 
-
385:	assertEquals(mBadDb.rawQuery("SELECT _id FROM Events;", null).getCount(), 2); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL, insert
37:	database.execSQL(table1); 
-
56:	database.insert(usersTable, null, entry); 
-
61:	database.execSQL("DROP TABLE IF EXISTS " + usersTable); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: beginTransaction, endTransaction, execSQL, setTransactionSuccessful
89:	db.execSQL("VACUUM;"); 
-
104:	db.beginTransaction(); 
-
106:	db.execSQL(sqlStatement); 
107:	db.setTransactionSuccessful(); 
-
112:	db.endTransaction(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: execSQL
46:	db.execSQL("CREATE TABLE "+ HASHTAG_TABLE +" (" + 
-
51:	db.execSQL("CREATE TABLE "+ TWEET_TABLE +" (" + 
-
59:	db.execSQL("CREATE TABLE "+ TWEET_USER_TABLE +" (" + 
-
68:	db.execSQL("CREATE TABLE "+ ID_INFORMATION_TABLE +" (" + 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: beginTransaction, endTransaction, execSQL, setTransactionSuccessful
203:	db.execSQL("CREATE TABLE favorites (" + 
-
224:	db.execSQL("CREATE TABLE gestures (" + 
-
348:	db.beginTransaction(); 
-
351:	db.execSQL("ALTER TABLE favorites " + 
-
353:	db.setTransactionSuccessful(); 
-
359:	db.endTransaction(); 
-
369:	db.beginTransaction(); 
-
371:	db.execSQL("CREATE TABLE gestures (" + 
-
381:	db.setTransactionSuccessful(); 
-
387:	db.endTransaction(); 
-
393:	db.execSQL("DROP TABLE IF EXISTS " + TABLE_FAVORITES); 
394:	db.execSQL("DROP TABLE IF EXISTS " + TABLE_GESTURES); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: execSQL
95:	db.execSQL(CREATE_TABLE_PLACES); 
96:	db.execSQL(CREATE_TABLE_DAY); 
97:	db.execSQL(CREATE_TABLE_TYPE); 
98:	db.execSQL(CREATE_TABLE_DISH); 
-
113:	db.execSQL("DROP TABLE IF EXISTS " + DISH); 
114:	db.execSQL("DROP TABLE IF EXISTS " + PLACE); 
115:	db.execSQL("DROP TABLE IF EXISTS " + TYPE); 
116:	db.execSQL("DROP TABLE IF EXISTS " + DAY); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: execSQL, insert
55:	db.execSQL("DROP TABLE IF EXISTS " + SYNC_STATE_TABLE); 
56:	db.execSQL("CREATE TABLE " + SYNC_STATE_TABLE + " (" 
-
64:	db.execSQL("DROP TABLE IF EXISTS " + SYNC_STATE_META_TABLE); 
65:	db.execSQL("CREATE TABLE " + SYNC_STATE_META_TABLE + " (" 
-
69:	db.insert(SYNC_STATE_META_TABLE, SYNC_STATE_META_VERSION_COLUMN, values); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: beginTransaction, endTransaction, execSQL, setTransactionSuccessful
187:	db.beginTransaction(); 
-
189:	db.execSQL("drop table if exists " + table); 
190:	db.setTransactionSuccessful(); 
-
192:	db.endTransaction(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: execSQL
44:	sqLiteDatabase.execSQL( 
-
56:	sqLiteDatabase.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close, execSQL, setVersion
25:	db.execSQL(CREATE_TABLE_EVENTS); 
26:	db.execSQL(CREATE_TABLE_MESSAGES); 
27:	db.execSQL(CREATE_TABLE_FEATURES); 
28:	db.execSQL(CREATE_TABLE_GLOBAL); 
29:	db.setVersion(DATABASE_VERSION); 
30:	db.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL
29:	db.execSQL("CREATE TABLE NFAVORITES (_ID INTEGER PRIMARY KEY AUTOINCREMENT,VIDEOID VARCHAR(40), TITLE VARCHAR(100),TPYE INTEGER,CHANNELID TEXT)"); 
30:	db.execSQL("CREATE TABLE NHISTORY (_ID INTEGER PRIMARY KEY AUTOINCREMENT,VIDEOID VARCHAR(40), TITLE VARCHAR(100),TIME VARCHAR(20),TPYE INTEGER,CHANNELID TEXT)"); 
-
33:	db.execSQL("CREATE TABLE DOWNLOADLIST (_ID INTEGER PRIMARY KEY AUTOINCREMENT,AID VARCHAR(40), VID VARCHAR(40),LOCALURI VARCHAR, REMOTEURI VARCHAR,TITLE VARCHAR(255), DURATION INTEGER,I INTEGER, MD5 VARCHAR,STATE INTEGER,DOWNLOADID INTEGER)"); 
-
36:	db.execSQL("ALTER TABLE DOWNLOADLIST ADD SIZE INTEGER"); 
-
39:	db.execSQL("ALTER TABLE DOWNLOADLIST ADD VTYPE VARCHER(10)"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: execSQL, setVersion
43:	database.execSQL(CREATE_TABLE_GHOSTS); 
44:	database.execSQL(CREATE_TABLE_CHANGE_VERSIONS); 
45:	database.execSQL(String.format("CREATE UNIQUE INDEX IF NOT EXISTS ghost_version ON ghosts (bucketName, simperiumKey, version)")); 
46:	database.setVersion(VERSION); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: execSQL, getVersion
105:	db.execSQL(create_tasks_table); 
-
192:	if (db.getVersion() == RC1_DATABASE) { 
-
253:	db.execSQL(createBackupTable); 
254:	db.execSQL(copyToBackup); 
255:	db.execSQL("DROP TABLE " + TABLE_TASKS); 
-
257:	db.execSQL(copyToTasksTable); 
258:	db.execSQL("DROP TABLE " + TABLE_BACKUP); 
-
260:	db.execSQL("DROP TABLE " + TABLE_COMPARATORS); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: execSQL, setLocale, setVersion
46:	db.setVersion(1); 
47:	db.setLocale(Locale.getDefault()); 
-
52:	db.execSQL(CREATE_USER_TABLE); 
-
56:	db.execSQL(CREATE_NOTIF_TABLE); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: close, beginTransaction, endTransaction, execSQL
48:	db.beginTransaction(); 
-
52:	db.execSQL(PM_MASTER_TABLE_CREATE); 
-
54:	db.execSQL("INSERT INTO "+MASTER_TABLE_NAME+" VALUES('master','Y');"); 
-
57:	db.execSQL(PM_STORED_PASSWORD_TABLE_CREATE); 
58:	db.execSQL("INSERT INTO "+PM_STORED_TABLE_NAME+" VALUES('Root','master','master');"); 
-
65:	db.endTransaction(); 
66:	db.close(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: execSQL, insert
23:	db.execSQL("CREATE TABLE IF NOT EXISTS people" 
-
32:	db.insert("people", null, values); 
Full Snippet Info
6
CodeRank
Related SQLiteDatabase execSQL Questions & Answers:
Other SQLiteDatabase execSQL Examples
38:					+ " TEXT," + KEY_RSS_LINK + " TEXT," + KEY_DESCRIPTION
39:					+ " TEXT" + ")";
40:			db.execSQL(CREATE_RSS_TABLE);
41:		}
42:	
-
45:		public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
46:			// Drop older table if existed
47:			db.execSQL("DROP TABLE IF EXISTS " + TABLE_RSS);
48:	
49:			// Create tables again

Read More

36:					+ KEY_ID + " INTEGER PRIMARY KEY," + KEY_NAME + " TEXT,"
37:					+ KEY_PH_NO + " TEXT" + ")";
38:			db.execSQL(CREATE_CONTACTS_TABLE);
39:		}
40:	
-
43:		public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
44:			// Drop older table if existed
45:			db.execSQL("DROP TABLE IF EXISTS " + TABLE_CONTACTS);
46:	
47:			// Create tables again

Read More

25:					+ KEY_ID + " INTEGER PRIMARY KEY," + KEY_NAME + " TEXT,"
26:					+ KEY_PH_NO + " TEXT" + ")";
27:			db.execSQL(CREATE_CONTACTS_TABLE);
28:		}
29:	
-
32:		public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
33:			// Drop older table if existed
34:			db.execSQL("DROP TABLE IF EXISTS " + TABLE_CONTACTS);
35:	
36:			// Create tables again

Read More

execSQL Method Overview
Execute a single SQL statement that is NOT a SELECT or any other SQL statement that returns data.
See Also