Birthday greeting SMS service with Oracle and Ozeki NG SMS Gateway software

This page provides you detailed setup instructions on how to send birthday SMS greetings from Oracle database with Ozeki NG SMS Gateway.

First of all you need to configure Ozeki NG SMS Gateway software to be able to send SMS messages from your PC. You can find step-by-step guide at: Quick start guide. The Ozeki SMS software is able to connect to the mobile network either with a GSM modem connection or IP SMS connection.

After you have configured your Ozeki NG SMS Gateway software and you can also install a service provider connection to connect the SMS software to the mobile network, you need to configure your Oracle database. Please find the configuration guide at: How to send SMS from Oracle.

If you have configured your system you can start to setup the birthday greeting SMS service with Oracle and Ozeki NG SMS Gateway software.

Configuration guide

So it is assumed that you have already installed Ozeki NG SMS Gateway software and Oracle database with all its components.

These are the main steps of the configuration of birthday greeting SMS service:

  1. Start SQL Developer (it is a component of Oracle database)
  2. Create the connection to database
  3. Create database table
  4. Create a sequence to move the ID
  5. Create a trigger to move the ID
  6. Load data into the database
  7. Install and configure a Database user in Ozeki NG SMS Gateway

To configure birthday greeting SMS service, start SQL Developer program of Oracle database in Start menu.

Add a new connection to the database by right clicking on

Connections and click on New Connection (Figure 1).

add a new connection
Figure 1 - Add new connection

Specify the parameters in the appeared window (Figure 2):
Connection Name: You can provide any name you wish (in our example it is "ozeki connection").
Username: the username you use to access to the database
Password: the password you use to access to the database

In SID field you need to enter the name that has been provided to the database when it is installed (installation name of the database).
Finally click on Connect.

specify parameters for connection
Figure 2 - Specify parameters for connection

On Figure 3 you can see that the connection has been created.

created connection
Figure 3 - Created connection

Now create a database table. In the empty field you can type the SQL statements that will create the required database table (Figure 4). To execute the SQL query click on the green arrow.

sql statement
Figure 4 - SQL statement

On Figure 5 you can see the created database table.

Figure 5 - Created table

Create a sequence to move the primary key (ID) of the table (Figure 6).

create sequence
Figure 6 - Create a sequence

On Figure 7 you can see the created sequence.

you can see the created sequence here
Figure 7 - Created sequence

You also need to create a trigger (Figure 8). This trigger uses the created sequence and moves the primary key (ID) of the table.

create a trigger
Figure 8 - Create a trigger

You can see the created trigger (Figure 9).

you can see the created trigger
Figure 9 - Created trigger

On Figure 10 you can also see the created trigger among the triggers of birthday table.

you can also see the created trigger among the triggers of birthday table
Figure 10 - Created trigger among the triggers of birthday table

Now you can enter data into the table (Figure 11) in the following way:

INSERT INTO birthday (customername, customerphone, birthdate) VALUES
('Elizabeth','+36301234567',DATE'2010-09-22');

Figure 11 - Enter data

Start Ozeki NG SMS Gateway service (Figure 12).

start the ozeki ng sms gateway
Figure 12 - Start Ozeki NG SMS Gateway

Log into Ozeki NG SMS Gateway (Figure 13).

login to ozeki ng sms gateway
Figure 13 - Login

Install a Database user by clicking on Add new user or application (Figure 14).

add new user or application
Figure 14 - Add new user or application

Select Database user interface and click on Install next to it (Figure 15).

install a database user
Figure 15 - Install Database user

Provide a name for the Database user - in our example it is "birthday_dbuser" (Figure 16).

provide a name for the database user
Figure 16 - Provide a name

Finally configure the installed Database user. On Database connection tab you need to specify the follows:
Connection string type: OleDb
Connection string:

Provider=OraOLEDB.Oracle.1;Persist Security Info=False;User ID=ozeki;Password=root;

configuration of database user
Figure 17 - Configuration of Database user

On SQL for sending tab you also need to specify the SQL statements.

Polling tab on SQL for sending panel:

SELECT id, '', customerphone, CONCAT(CONCAT(CONCAT(CONCAT('Hello ',customername),
'! The day of your birthday is: '), birthdate), ' Congratulations!')
FROM birthday
WHERE (EXTRACT(MONTH FROM CURRENT_DATE)=EXTRACT(MONTH FROM birthdate))
AND (EXTRACT(DAY FROM CURRENT_DATE)=EXTRACT(DAY FROM birthdate))
AND ((lastnotified is null) or (not(EXTRACT(YEAR FROM CURRENT_DATE))=(EXTRACT(YEAR
FROM lastnotified))))

the polling tab
Figure 18 - Polling tab

Sending tab on SQL for sending panel:

UPDATE birthday SET status='sending', lastnotified=current_date WHERE id='$id'

the sending tab
Figure 19 - Sending tab

Sent tab on SQL for sending panel:

UPDATE birthday SET status='sent', lastnotified=current_date WHERE id='$id'

sent tab
Figure 20 - Sent tab

Notsent tab on SQL for sending panel:

UPDATE birthday SET status='notsent', lastnotified=current_date WHERE id='$id'

not send tab
Figure 21 - Not sent tab

Delivered tab on SQL for sending panel:

UPDATE birthday SET status='delivered', lastnotified=current_date WHERE id='$id'

the delivered messages tab
Figure 22 - Delivered

Undelivered tab on SQL for sending panel:

UPDATE birthday SET status='undelivered', lastnotified=current_date WHERE id='$id'

the undelivered messages tab
Figure 23 - Undelivered

On Figure 24 you can see that Ozeki NG SMS Gateway has sent out the test messages after I followed the configuration steps above.

the sent messages in ozeki ng sms gateway
Figure 24 - Sent messages in Ozeki NG SMS Gateway

On Figure 25 you can also see that the status of the birthday greetings has also been modified to "sent" in the database.

status is sent
Figure 25 - Status is sent

More information