Create SQL Anywhere Database

In this video series you can see how to connect Ozeki SMS Gateway to an SQL Anywhere database server for SMS messaging. This video shows how to create the proper database table structure by using the GUI of your SQL Anywhere database server.

Video content
1. Start SQL Central
2. Create Database
3. Connect to Database
4. Run CREATE TABLE statements

Please scroll down to copy the SQL statements (Figure 1) used in the video. If you have created the database in SQL Anywhere, you can jump to the next video.

Create SQL Anywhere database
Figure 1 - Create SQL Anywhere database by clicking 'Create database...'

Create SQL Anywhere database
Figure 2 - Create Database Wizard

Select database location
Figure 3 - Select the machine where to store the database

Specify database's directory
Figure 4 - Specify the database's location in the filesystem

Select log file
Figure 5 - Select where to use the transaction log on your filesystem

Specify the DBA user
Figure 6 - Create a DBA user. This user will have rights to the database

Select Encryption settings
Figure 7 - Select the type of encryption you prefer

Specify Page size
Figure 8 - Specify the size of the database you wish to create

Choose additional settings
Figure 9 - Choose additional database settings

Specify Collation settings
Figure 10 - Specify the collation sequence to perform alphanumeric sorting operations in the database

 Choose the Security model
Figure 11 - Choose the security model for the system procedures

Your database have been created, so you can add a name and connect to it (Figure 12)

Connect to database
Figure 12 - Connect to database by using the server and database name

Create database has finished
Figure 13 - Run CREATE DATABASE SQL statement

Open interactive SQL
Figure 14 - Open interactive SQL in the freshly opened SQL Central

Connect to database
Figure 15 - Connect to your database with the DBA user credentials you have previously set

SQL Anywhere CREATE TABLE statements to copy:

CREATE TABLE "ozekimessagein"
(
"id" integer NOT NULL DEFAULT autoincrement ,
"sender" varchar(255) NULL ,
"receiver" varchar(255) NULL ,
"msg" varchar(160) NULL ,
"senttime" varchar(100) NULL ,
"receivedtime" varchar(100) NULL ,
"operator" varchar(100) NULL ,
"msgtype" varchar(160) NULL ,
"reference" varchar(100) NULL ,
 PRIMARY KEY ("id"),
)
go
commit work
go

CREATE TABLE "ozekimessageout"
(
"id" integer NOT NULL DEFAULT autoincrement ,
"sender" varchar(255) NULL ,
"receiver" varchar(255) NULL ,
"msg" varchar(160) NULL ,
"senttime" varchar(100) NULL ,
"receivedtime" varchar(100) NULL ,
"operator" varchar(100) NULL ,
"status" varchar(20) NULL ,
"msgtype" varchar(160) NULL ,
"reference" varchar(100) NULL ,
"errormsg" varchar(250) NULL ,
 PRIMARY KEY ("id"),
)
go
commit work
go

CREATE INDEX "ozekimessageinindex" ON "ozekimessagein"
(
"id" ASC
)
go
commit work
go

CREATE INDEX "ozekimessageoutindex" ON "ozekimessageout"
(
"id" ASC
)
go
commit work
go
Figure 16 - CREATE TABLE statements to copy

Copy CREATE TABLE statements from Figure 3
Figure 17 - Copy CREATE TABLE statements from Figure 16

Run CREATE TABLE statements on the database
Figure 18 - Paste CREATE TABLE statements and run them on the SQL Anywhere database server

More information