Ozeki 10 SMS Gateway
PostgreSQL PostgreSQL | SQL Anywhere Installation SQL Anywhere Installation

SMS from/to SAP SQL Anywhere

See how to send and receive SMS messages through an SAP SQL Anywhere server with the Database User of Ozeki SMS Gateway. Here you can find a connection string and short CREATE TABLE statements to get started. You can send messages by inserting new message records.

Send SMS messages with SQL Anywhere
SQL Anywhere Installation(Video guide)
Create Database Tables (Video guide)
Configure Database User (Video guide)
Send Test Message (Video guide)

You should have two important programs. The first one is an SAP SQL Anywhere server, while the second one is Ozeki SMS Gateway, which must have a Database User installed, so it can connect to the SAP SQL Database Server using a connection string. Please create a table for the incoming messages and another table for the outgoing messages. You should call these tables as 'ozekimessagein' and 'ozekimessageout', which is used in the current example. You can see your received SMS messages by using a simple SELECT and you can send SMS message with a simple INSERT SQL statement.

The browser GUI of Ozeki SMS Gateway can be used for installing a Database User. Please provide the ODBC connection string for your SAP SQL Anywhere database. The Database User can be configured from the browser GUI. Keep in mind to select 'Odbc' and type the connection string (Figure 2).

Connection Type:ODBC
Connection String:Driver={SQL Anywhere 17}; Host=127.0.0.1;Server=ozekisms;port=2683; db=ozekisms;uid=ozeki;pwd=qwe123;
Figure 1 - Example ODBC connection string, which needs to be modified

Please use the information of your SAP SQL Anywhere server and change the connection string variables (Figure 2).


Figure 2 - Modify the connection string variables according to your SAP SQL Anywhere database

SAP SQL Anywhere CREATE TABLE script

Please create the 'ozekimessageout' and 'ozekimessagein' tables on your SAP SQL Anywhere database server.

CREATE TABLE "ozekimessagein"
(
 "id"       integer NOT NULL DEFAULT autoincrement ,
 "sender"          varchar(160) NULL ,
 "receiver"        varchar(160) 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(160) NULL ,
 "receiver"        varchar(160) 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

The size of the 'msg' field can be always increased above 160 characters. You can also change it's data type as well.

The index of each record is the 'id' attribute. Please maintain the 'id' in all tables.

 
Copyright © 2000- - Ozeki Ltd | info@ozeki.hu
Home > Developers guide > SMS from SQL > SQL Anywhere
Legal | Privacy | Terms of use | 5775
100.24.125.162 | 92.118.27.157 | Login