我想创建程序,通过oracle11g数据库向印度移动用户发送短信。 我搜索了很多,但找不到一个简洁的程序
答案 0 :(得分:1)
答案 1 :(得分:0)
您可以包装整个过程并针对表触发器或通过用户表单
提供的按钮单击来调用它SET serveroutput ON
SET Define OFF
DECLARE
HTTP_REQ UTL_HTTP.REQ;
HTTP_RESP UTL_HTTP.RESP;
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';
BEGIN
DBMS_OUTPUT.ENABLE(1000000);
--Based on your service provider, the following link format may differ from
--What we have specified below!
URL := 'http://yourwebsmsdomain.com/alerts/api/web2sms.php?username=demo&password=demo2&to=95xxxxxxx&sender=ODBSMS&message='||
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
LOOP
BEGIN
URL_TEXT := null;
UTL_HTTP.READ_LINE(HTTP_RESP, URL_TEXT, TRUE);
DBMS_OUTPUT.PUT_LINE(URL_TEXT);
EXCEPTION
WHEN OTHERS THEN EXIT;
END;
END LOOP;
UTL_HTTP.END_RESPONSE(HTTP_RESP);
END;
答案 2 :(得分:-1)
您需要设置一个Web服务(可以从Oracle调用的php文件),您可以使用soap_api。