Hi guys
We are setting up our database to send SMS through a gateway and having a small problem with parsing the message to htl_http package. We use the below script to send SMS
DECLARE
HTTP_REQ UTL_HTTP.REQ;
HTTP_RESP UTL_HTTP.RESP;
URL_TEXT VARCHAR2(32767);
URL VARCHAR2(2000);
SMS_MSG VARCHAR2(160) :='This is a test message sent from Oracle Database';
BEGIN
DBMS_OUTPUT.ENABLE(1000000);
URL := 'http://mysmsgateway/alerts/api/web2sms.php?username=test&password=test&to=9999555555&sender=ORASMS&message='||SMS_MSG;
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;
Now our problem is, while the SMS is received, we just get "This" which is the first word from SMS_MSG variable. It is due to escape character handling, we believe. How do we "Escape" this issue?
Any suggestions?
Regards,
Raj