Tested on 10g 10.2.0.3 database with default installation(no additional packages were installed to achieve the results)
There are many APIs (developed by 3rd parties) which will allow you to send SMS from a Oracle database on demand. Many times such APIs would become costly, depending upon your requirements.
Here, we are providing a zero cost solution, incase if your SMS gateway provider allows you to send SMS through a web service portal.
You may wrap the entire procedure and call it against a table trigger or through a button click available with user form(s)
SET SERVEROUTPUT ON;
SET DEFINE OFF;
URL_TEXT VARCHAR2 (32767);
URL VARCHAR2 (2000);
SMS_MSG VARCHAR2 (160):= 'Congratulations! Your database has been configured propoerly for sending SMS through a 3rd party SMS Gateway';
--Based ON your SERVICE provider, THE FOLLOWING LINK FORMAT may differ FROM
--What we have specified below!
|| UTL_URL.Escape (SMS_MSG, TRUE);
--UTL_URL.Escape manages ESCAPE CHARACTERS LIKE SPACE BETWEEN words IN A message.
HTTP_REQ := UTL_HTTP.BEGIN_REQUEST (URL);
UTL_HTTP.SET_HEADER (HTTP_REQ, 'User-Agent', 'Mozilla/4.0');
HTTP_RESP := UTL_HTTP.GET_RESPONSE (HTTP_REQ);
-- PROCESS Request
URL_TEXT := NULL;
UTL_HTTP.READ_LINE (HTTP_RESP, URL_TEXT, TRUE);
Enjoy another quality solution from us :)