So I go into directory with sqlite3.exe
and open it with double click then I type in the following commands (I'm including foreign keys pragma as I will need it in the future):
PRAGMA FOREIGN_KEYS=ON;
CREATE TABLE `countries` (
`country_id` INTEGER NOT NULL,
`name` TEXT NOT NULL UNIQUE,
PRIMARY KEY(country_id)
);
INSERT INTO `countries` VALUES
(1,'Japan'),
(2,'China');
.save countries
This gives me a file with no extension type, only: countries
But all the tutorials I see for opening a pre-made/existing database in android they use to open file with extensions such as example.db
or example.sqlite
What am I missing?
When I try to open this file with ORMlite I get:
java.sql.SQLException: Problems executing runExecute Android statement: CREATE TABLE `countries` (`name` VARCHAR , `country_id` INTEGER PRIMARY KEY AUTOINCREMENT )
please help
Aucun commentaire:
Enregistrer un commentaire