Skip to Main Content
  • Questions
  • Can I send messages on mobile phone from Oracle database?

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Ashish.

Asked: August 08, 2000 - 3:06 pm UTC

Last updated: August 15, 2016 - 12:12 pm UTC

Version: 8.1.5

Viewed 10K+ times! This question is

You Asked

Hi TOM,

We are running an application on Oracle 8.1.5 on solaris and oas 4.081. We are using basic oracle users for authentication. We want to develop a new functionality in our system by which we will be able to send messages on the user's mobile phones. Currently, whenever a new activity happens for any user we send a mail to the user asking him to log on to the site and find out the details. In the similar way can we send text messages on the user's mobile phone along with the emails?


Thanks,

ashish

and Tom said...

depends on the phone service.

I know someone with a pager that we can send a text message to via EMAIL or a URL. Every night we have a job that queries tomorrows schedule -- formats a text message and uses UTL_HTTP to run a URL on the pagers website that sends him a page.

If your phone service provider has a similar setup -- then yes, either sending an email or running a URL can be used.. You'd have to find out if thats available.

short of that -- if they have an api, a C or Java external procedure can do virtually anything you want.

Rating

  (9 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

can i send messages to mobile phone from database version 9.2.0.5.0

John Binny, February 18, 2005 - 3:34 am UTC

Our application are running on Oracle 9.2.0.5.0 on Unix 11.11. we would like to get touch with our customers by sending message to their mobile phones. we would like to do this from the database side. how can we achinve this?

Tom Kyte
February 18, 2005 - 8:10 am UTC

same answer above applies.


iAS (middle tier) has more wireless/mobile options, but from the database, you pretty much can send email (utl_smtp)...

sms from oracle database

venkat viswanathan, February 18, 2005 - 8:23 am UTC

There are two solutions
1) Some service providers will recognise emails and interpret them as sms and send it to the appropriate person. you can try sending it as phone number@serviceprovider.com (e.g. 9825666@att.com).

2) You can try webservices. e.g. goto wehservicex.net. there are free webservices for sending sms. You create a webservice stub, then create a java class for that . You can write a plsql wrapper package. This you can call from your application

Thanks

Send SMS From Oracle to Mobile Device

Muhammad Waseem Haroon, April 11, 2006 - 1:46 pm UTC

Tom,
I hope that you will fine. Tom, Here I am sending My Suggestion & Experience to Send SMS From Oracle to Mobile Device.

There is a Way to send Message From Oracle Database Server to Mobile Device.

One Way is to Send Email using Oracle SMTP Package - [UTL_SMTP].
----------------------------------------------------------------
Mostly Cellular Service Providers give the Facility to their Post-Paid Users to Recieve Email on Post-Paid Connections.{Mobile_No@Service_Provider_Domain.com} is the E-Mail Address for Post-Paid Connection Holder.
e.g. +923003338669@mobilinkgsm.com.

In this Way, Install/Configure Oracle Database 8.x/9.x/10.x and Create a Package.
</code> http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/maildemo_sql.txt

BEGIN 
     demo_mail.mail(
                    sender => 'Me <me@some-company.com>',
                    recipients => 'Someone <Mobile_No@Celluler_Service_Provider_Domain.com>' ,                       subject    => 'SMS From Oracle Database Server',                       
                    message => 'Hi! This is a test Message.'
                    );
END;
/

Second Way is to Send SMS Using GSM Modem/Mobile Phone & its Supporting Software/Utility:
-----------------------------------------------------------------------------------------

There are many software/utilities/Tools which can do this, but here i am using a free project.
In this Way, Install/Configure:

* Red Hat Linux Operating System
* Oracle Database 8i/9.x/10.x
* Gnokii - For Nokia Mobile Phone
                       
To Download Gnokii:
http://gnokii.org/download/gnokii/0.6.x/gnokii-0.6.2.tar.gz
To Install Gnokii:
http://urtica.linuxnews.pl/~pkot/gnokii/gnokii.html#ch1
Gnokii Sample File:
http://cvs.savannah.nongnu.org/viewcvs/gnokii/gnokii/Docs/sample/gnokiirc?rev=1.22
Gnokii User Guide:
http://wiki.gnokii.org/index.php/User%27s_Guide
              
* Nokia Mobile Phone With Data Cable
http://www.gnokii.org/cables.shtml

Try to Send SMS Using the Command.

Waseem$ echo "This is a test SMS using Gnokii-Linux..." | gnokii --sendsms +923003338669

Note : Message Length = 160 Characters.

It Will Take 30 - 40 Seconds and will send the SMS to the desired Number.

To Test & Configure it in Oracle Database, you have to Create a Java Class.

http://www.oracle-base.com/articles/8i/ShellCommandsFromPLSQL.php <code>


SET SERVEROUTPUT ON SIZE 1000000
CALL DBMS_JAVA.SET_OUTPUT(1000000);
BEGIN
Host_Command (p_command => 'echo "This is a test SMS from Oracle Database." | gnokii --sendsms +923003338669');
END;
/


I have tried it on Nokia 6030 and its Working.


Best Regards
Muhammad Waseem Haroon
waseemharoon@gmail.com
mwaseem_haroon@yahoo.com
ocp_waseem@hotmail.com

Problem on windows

Leonardo, August 08, 2006 - 5:13 am UTC

Hi, I tried gnooki and it works from dos promt, but I'm unable to send sms or dial a test phone number from oracle.
I receive the message "Procedure successfully completed" but nothing happens.
Thank you.
Bye, Leo


Tom Kyte
August 08, 2006 - 7:56 am UTC

eh?

I don't even know what procedure you are running.

RE

A reader, August 08, 2006 - 8:10 am UTC

This for example:
This for example:

SET SERVEROUTPUT ON SIZE 1000000
CALL DBMS_JAVA.SET_OUTPUT(1000000);
BEGIN
Host_Command (p_command => 'echo "This is a test SMS from Oracle Database." |
gnokii --sendsms +923003338669');
END;
/


Tom Kyte
August 08, 2006 - 8:14 am UTC

I did not write, nor do I support "host_command", so best to ask the author? Tim Hall...

Re

Leonardo, August 08, 2006 - 8:27 am UTC

Ok, thank you anyway.
I'm not very expert, sorry.
I'm trying to send sms through the databse.
Initially I enableb the database jvm.
then I loaded the comm api from sun plus a small java application which lists com ports.
calling the application from the command prompt I see the com port list on my pc, but nothing if I call the function from sqlplus. Everything seems to be ok, but no port are listed.
any idea?
thank you.

Tom Kyte
August 09, 2006 - 9:44 am UTC

send sms from oracle

A reader, January 03, 2007 - 1:03 pm UTC

Hi Tom

I don't have any knowledge about java.
I have an assignment to write code to send sms to customers about their balance in oracle pl/sql.
Is there any inbuilt package to do that.
Tom Kyte
January 05, 2007 - 8:26 am UTC

how do you intend to interact with SMS?

do you have a vendor API to invoke?

Or are you just going to send email. Sending email is trivial (utl_smtp or utl_mail depending on release).

just send mail, easy.

Sending SMS from Oracle DB

MANDJOLI Nadine, June 01, 2009 - 9:41 am UTC

Please, Tom I have to create a job which will be sending an SMS upon a trigger from a DML on particular tables. Please, could I have any description of this from you?
Thanks
Tom Kyte
June 01, 2009 - 8:17 pm UTC

turned around to you

how do you send an SMS?????

I know of various ways, what is YOUR METHOD??????

for example:

one very valid approach:

a) hire someone (probably a group of someones, you want 24x7 coverage)
b) give them a cell phone
c) teach them how to send a text message
d) teach them a query to run constantly (they will just keep hitting "/" in sqlplus)
e) when they see something from this query - they will text you


You do not want the trigger to send the text, you want to queue a job that after the transaction commits will send a text - but you need to tell us what sort of API you might have (eg: I can send an email to my phone, that'll get translated as a SMS message - I have utl_smtp to send mail....).

Think about it - you NEVER EVER want to do something none transactional (like SMS) in a trigger, SMS doesn't "roll back"

You can send SMS from oracle DB using utl_http

satish chander, August 15, 2016 - 11:04 am UTC

Connor McDonald
August 15, 2016 - 12:12 pm UTC

Thanks, nice input

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library