Member_2_6478753
asked on
MS SQL server programming
i want to create a procedure for mssql
to fetch all row in table dbo sms in !!!!!! to proccess the content of message
when i select the row i try to select the field message and
i will go to select from table dbo.channel and select the channelid where dbo.smsin.message = dbo.channel.subscriptionco de
if it's equal insert into table dbo.subscription the msisdn and the channelid
to subscripe the user for this service.
else
no channelid try to insert into another table for reporting...
DECLARE @shortcode INT
DECLARE @message varchar(50)
DECLARE @msisdn varchar(50)
DECLARE sms_in_cur CURSOR FOR
SELECT shortcode,message,msisdn
FROM dbo.CGI_SMS_dafif;
OPEN sms_in_cur
FETCH NEXT FROM sms_in_cur INTO @msisdn, @message, @shortcode
WHILE @@FETCH_STATUS = 0
BEGIN
/*
*/
FETCH NEXT FROM sms_in_cur INTO @msisdn, @message, @shortcode
END
CLOSE sms_in_cur;
DEALLOCATE sms_in_cur;
dbo-sms-in.png
dbo.channel.png
dbo.subscription.png
to fetch all row in table dbo sms in !!!!!! to proccess the content of message
when i select the row i try to select the field message and
i will go to select from table dbo.channel and select the channelid where dbo.smsin.message = dbo.channel.subscriptionco
if it's equal insert into table dbo.subscription the msisdn and the channelid
to subscripe the user for this service.
else
no channelid try to insert into another table for reporting...
DECLARE @shortcode INT
DECLARE @message varchar(50)
DECLARE @msisdn varchar(50)
DECLARE sms_in_cur CURSOR FOR
SELECT shortcode,message,msisdn
FROM dbo.CGI_SMS_dafif;
OPEN sms_in_cur
FETCH NEXT FROM sms_in_cur INTO @msisdn, @message, @shortcode
WHILE @@FETCH_STATUS = 0
BEGIN
/*
*/
FETCH NEXT FROM sms_in_cur INTO @msisdn, @message, @shortcode
END
CLOSE sms_in_cur;
DEALLOCATE sms_in_cur;
dbo-sms-in.png
dbo.channel.png
dbo.subscription.png
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
and if the message is not the same of susbrictioncode found in channel i insert in specific table a notifcation to send later.. a sms to him !!
so who i can write it :S
so who i can write it :S
ASKER
i work in nowsms all msg received from mobile operator will be stored on cgi_sms_received
table , i am new employer in my company i have already found this main trigger kindly find the attachment documents !
the main trigger SELECT top 20 ID,ReqPort,RecdPort,Messag e,Msisdn,c oding FROM cgi_sms_received
and try to fetch all record ! and see sms sent to specific short code using
if(ltrim(rtrim(@reqport)) = 752267) begin
insert into CGI_SMS_d752267(reqport,re cdport,mes sage,msisd n,coding) values (@reqport,@recdport,@messa ge,@msisdn ,@coding)
end
so for example cgi_sms_d752267 is db sms in
now i want to add new procedure to proccess all send sms for subscribe user to specific service when matching the content of message !! with suscription code on channel table
than i will insert autmaticly a new record on suscription table and i before suscription i should check if user is already subscribed if he already suscribe to this service i insert in report a notification alert !! !!!
this is my problem each couple of second i recive new sms on this short code table ..
and i want to process it so what is the good solution .??
and i need to make a application to fetch all row to process it ??
and please tell me if i want to put it as new question :)
main-trigger.docx
table , i am new employer in my company i have already found this main trigger kindly find the attachment documents !
the main trigger SELECT top 20 ID,ReqPort,RecdPort,Messag
and try to fetch all record ! and see sms sent to specific short code using
if(ltrim(rtrim(@reqport)) = 752267) begin
insert into CGI_SMS_d752267(reqport,re
end
so for example cgi_sms_d752267 is db sms in
now i want to add new procedure to proccess all send sms for subscribe user to specific service when matching the content of message !! with suscription code on channel table
than i will insert autmaticly a new record on suscription table and i before suscription i should check if user is already subscribed if he already suscribe to this service i insert in report a notification alert !! !!!
this is my problem each couple of second i recive new sms on this short code table ..
and i want to process it so what is the good solution .??
and i need to make a application to fetch all row to process it ??
and please tell me if i want to put it as new question :)
main-trigger.docx
ASKER
and this short code is sms in ..
so i have a procedure to fetch all row in the first table and put it in sms in
than i want to proccess all message on sms in after i have copied from the first table to sms in ..the processing is by send sms to subscribed users..
and who i can check if user has already subscribed? if he is already subscribed it insert a row in table like report !! to give me feedback