Thursday, February 26, 2009

sqlite command in adb

Connect to a database:

adb shell

# sqlite3 data/data/com.google.android.providers.contacts/databases/contacts.db

sqlite3 data/data/com.google.android.providers.contacts/databases/contacts.db

SQLite version 3.5.0

Enter ".help" for instructions

List tables:

.table

Print some of the information from the tables:

.header on

.mode column

sqlite> .header on

.header on

sqlite> .mode column

.mode column

sqlite> select * from phones;

select * from phones;

_id         person      type        number        number_key    label

----------  ----------  ----------  ------------  ------------  ----------

1           1           1           +15085551212  21215558051+

2           1           0           +17815551212  21215551871+

3           1           2           +16175551212  21215557161+

.help can tell you more useful command.

LIKE Operator Example
SELECT * FROM Persons WHERE City LIKE 's%';

No comments:

Post a Comment

You can leave any question here and I will make a response to you ASAP. :D