I have a database sqlite in my app and I need modify with a new table and several records.
How I can read the this SQL file (present in Assets) and update the database:
How I can read the this SQL file (present in Assets) and update the database:
B4X:
-- Table: book
CREATE TABLE book (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR(50),
author VARCHAR(50),
purchaseDate DATE
);
INSERT INTO book (id, name, author, purchaseDate) VALUES (null,"Harry Potter and the Philosophers Stone","J.K. Rowling","20/07/2014")
INSERT INTO book (id, name, author, purchaseDate) VALUES (null,"Harry Potter and the Chamber of Secrets ","J.K. Rowling","22/08/2014")
INSERT INTO book (id, name, author, purchaseDate) VALUES (null,"Harry Potter and the Prisoner of Azkaban","J.K. Rowling","12/09/2014")
INSERT INTO book (id, name, author, purchaseDate) VALUES (null,"Harry Potter and the Goblet of Fire","J.K. Rowling","22/10/2014")
INSERT INTO book (id, name, author, purchaseDate) VALUES (null,"Harry Potter and the Order of the Phoenix","J.K. Rowling","23/10/2014")
INSERT INTO book (id, name, author, purchaseDate) VALUES (null,"Harry Potter and the Half-Blood Prince","J.K. Rowling","25/10/2014")
INSERT INTO book (id, name, author, purchaseDate) VALUES (null,"Harry Potter and the Deathly Hallows,","J.K. Rowling","30/10/2014")