To understand the concept of Mimer SQL Mobile, the steps when developing an application will be described.
First we create a database in the development environment on the workstation. This will be the database used for the development.
Let us imagine a simple GUI for the application. It shows a selection list where a name can be chosen and the corresponding address is displayed.
We must have a data model for the application. It is formed on two tables where one is storing names and the other is storing addresses. The tables are coupled together using the foreign key clause. The following SQL statements are creating the tables:
CREATE TABLE person(
pnr INT,
name NCHAR VARYING(50),
surname NCHAR VARYING(50),
PRIMARY KEY(pnr));
CREATE TABLE person_address(
address_id INT DEFAULT NEXT_VALUE OF address_id_seq,
pnr INT,
phone NCHAR(10),
zipcode NCHAR(10),
address NCHAR VARYING(100),
city NCHAR VARYING(50),
PRIMARY KEY(address_id),
FOREIGN KEY(pnr) REFERENCES person(pnr));
In addition, we need some statements to be used on the device. As an example, the following statements are created:
CREATE STATEMENT select_persons
SELECT pnr, name, surname
FROM person;
CREATE STATEMENT select_address
SELECT address_id, phone, zipcode, address, city
FROM person_address
WHERE pnr=:pnr_value;
CREATE STATEMENT insert_person
INSERT INTO person (pnr, name, surname)
VALUES (:pnr, :name, :surname);
CREATE STATEMENT insert_address
INSERT INTO person_address (pnr, phone, zipcode, address, city)
VALUES (:pnr, :phone, :zipcode, :address, :city);
Now, a Remote Database for the target environment should be created, i.e. for the device or for the emulation environment depending on the protocol type chosen. When completed, it is possible to export the complete development database environment to the remote database on the device or on the emulation environment, where it will be accessible immediately, by the Mimer Explorer.
When the database application, as described above, is developed it should be packaged for installation on the target device, installed and the executed.