<?xml version="1.0" encoding="windows-1251"?>
<rss version="0.92">
<channel>
<title>Sw4me - SMSReceptionCenter/MSSQL</title>
<link>http://www.sw4me.com/wiki/SMSReceptionCenter/MSSQL</link>
<description>History/revisions of Sw4me/SMSReceptionCenter/MSSQL</description>
<language>en-us</language>
<item>
<title>2006-04-04 05:21:54</title>
<link>http://www.sw4me.com/wiki/SMSReceptionCenter/MSSQL/show?time=2006-04-04+05%3A21%3A54</link>
<description>&lt;a name="h65-1">&lt;/a>&lt;h2>SmsRc and&amp;nbsp;MSSQL&lt;/h2>&lt;a name="p65-1">&lt;/a>&lt;p class="auto" id="p65-1">
Microsoft SQL&amp;nbsp;Server supports a&amp;nbsp;very powerful SQL&amp;nbsp;dialect. A&amp;nbsp;lot of&amp;nbsp;our customers prefer to&amp;nbsp;use SmsRc just as&amp;nbsp;a gateway between the&amp;nbsp;phone and&amp;nbsp;the server, implementing all&amp;nbsp;&lt;span class="nobr">SMS-handling&lt;/span> logic in&amp;nbsp;the server's stored procedures.&lt;/p>&lt;br />&lt;a name="p65-2">&lt;/a>&lt;p class="auto" id="p65-2">
For&amp;nbsp;this type of&amp;nbsp;project, the&amp;nbsp;file with just one&amp;nbsp;&lt;a href="http://sw4me.com/wiki/SMSReceptionCenter/actions/ExecuteSQL" target="_blank" title="Outgoing link
(in new window)" class="outerlink">&lt;img src="http://www.sw4me.com/wiki/themes/tabs/icons/web.gif" alt="" border="0" />ExecuteSQL&lt;/a> action must be&amp;nbsp;created. The&amp;nbsp;SQL statement must call the&amp;nbsp;stored procedure that is&amp;nbsp;ready to&amp;nbsp;handle incoming messages. Using appropriate ODBC escape sequence, the&amp;nbsp;statement will look like this one:&lt;/p>&lt;br />&lt;a name="p65-3">&lt;/a>&lt;p class="auto" id="p65-3">
&lt;!--notypo-->&lt;div class="code">&lt;code>&lt;font color=green>&lt;b>&lt;/b>&lt;/font>{&amp;nbsp;CALL&amp;nbsp;sp_incoming_sms&amp;nbsp;(&amp;nbsp;[%Timestamp%],&amp;nbsp;&amp;nbsp;[%Sender%]&amp;nbsp;,&amp;nbsp;[%Message%]&amp;nbsp;)&amp;nbsp;}&lt;font color=green>&lt;b>&lt;/b>&lt;/font>&lt;/code>&lt;/div>&lt;!--/notypo-->&lt;/p>&lt;a name="h65-2">&lt;/a>&lt;h3> Returning the&amp;nbsp;Answer  &lt;/h3>&lt;a name="p65-4">&lt;/a>&lt;p class="auto" id="p65-4">
There are&amp;nbsp;two ways to&amp;nbsp;send the&amp;nbsp;answer  from the&amp;nbsp;stored procedure. &lt;/p>&lt;ol type="1">&lt;li> The&amp;nbsp;procedure may&amp;nbsp;return one&amp;nbsp;row of&amp;nbsp;data, so&amp;nbsp;the values in&amp;nbsp;its columns will be&amp;nbsp;assigned to&amp;nbsp;SmsRc variables. &amp;#147;Expected result format&amp;#148; field in&amp;nbsp;the action must be&amp;nbsp;set to&amp;nbsp;&amp;#147;one selected records&amp;#148;, and&amp;nbsp;the &amp;laquo;Store result to&amp;nbsp;variable(s)" field must contain &lt;em>variable names, corresponding to&amp;nbsp;columns, separated by&amp;nbsp;spaces&lt;/em>. Then you&amp;nbsp;may add&amp;nbsp;a&amp;nbsp;&amp;#147;Send SMS&amp;#148; action, using the&amp;nbsp;variables returned from the&amp;nbsp;procedure in&amp;nbsp;the message body.
&lt;/li>&lt;li> The&amp;nbsp;procedure may&amp;nbsp;insert rows into the&amp;nbsp;table named &lt;strong>OutgoingSMs&lt;/strong>, thay may&amp;nbsp;be&amp;nbsp;created with the&amp;nbsp;following statement: &lt;!--notypo-->&lt;div class="code">&lt;code>&lt;font color=blue>CREATE&lt;/font>&amp;nbsp;&lt;font color=blue>TABLE&lt;/font>&amp;nbsp;OutgoingSMs&amp;nbsp;(&lt;br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[MsgID]&amp;nbsp;&lt;font color=blue>int&lt;/font>&amp;nbsp;&lt;font color=blue>IDENTITY&lt;/font>&amp;nbsp;(&lt;font color=green>&lt;b>1&lt;/b>&lt;/font>,&amp;nbsp;&lt;font color=green>&lt;b>1&lt;/b>&lt;/font>)&amp;nbsp;&lt;font color=blue>NOT&lt;/font>&amp;nbsp;&lt;font color=blue>NULL&lt;/font>&amp;nbsp;,&lt;br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[MsgText]&amp;nbsp;nvarchar&amp;nbsp;(&lt;font color=green>&lt;b>254&lt;/b>&lt;/font>)&amp;nbsp;&amp;nbsp;&lt;font color=blue>NOT&lt;/font>&amp;nbsp;&lt;font color=blue>NULL&lt;/font>&amp;nbsp;,&lt;br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[MsgStatus]&amp;nbsp;&lt;font color=blue>int&lt;/font>&amp;nbsp;&lt;font color=blue>NOT&lt;/font>&amp;nbsp;&lt;font color=blue>NULL&lt;/font>&amp;nbsp;,&lt;br />
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[MsgTarget]&amp;nbsp;&lt;font color=blue>varchar&lt;/font>&amp;nbsp;(&lt;font color=green>&lt;b>12&lt;/b>&lt;/font>)&amp;nbsp;&amp;nbsp;&lt;font color=blue>NOT&lt;/font>&amp;nbsp;&lt;font color=blue>NULL&lt;/font>&amp;nbsp;&lt;br />
)&amp;nbsp;&lt;font color=blue>ON&lt;/font>&amp;nbsp;[&lt;font color=blue>PRIMARY&lt;/font>]&lt;br />
&lt;font color=blue>GO&lt;/font>&lt;/code>&lt;/div>&lt;!--/notypo-->As the&amp;nbsp;rows get&amp;nbsp;inserted into this table with &lt;strong>MsgStatus=0&lt;/strong>, SmsRc will try&amp;nbsp;to&amp;nbsp;send out&amp;nbsp;appropriate messages and&amp;nbsp;update MsgStatus to&amp;nbsp;1 on&amp;nbsp;success, 2 on&amp;nbsp;error.&lt;/li>&lt;/ol> </description>
</item>
<item>
<title>2006-04-04 05:08:01</title>
<link>http://www.sw4me.com/wiki/SMSReceptionCenter/MSSQL/show?time=2006-04-04+05%3A08%3A01</link>
<description>edited by AntonKovalenko</description>
</item>
<item>
<title>2006-04-04 05:02:57</title>
<link>http://www.sw4me.com/wiki/SMSReceptionCenter/MSSQL/show?time=2006-04-04+05%3A02%3A57</link>
<description>edited by AntonKovalenko</description>
</item>
<item>
<title>2006-04-04 05:01:21</title>
<link>http://www.sw4me.com/wiki/SMSReceptionCenter/MSSQL/show?time=2006-04-04+05%3A01%3A21</link>
<description>edited by AntonKovalenko</description>
</item>
<item>
<title>2006-04-04 05:00:18</title>
<link>http://www.sw4me.com/wiki/SMSReceptionCenter/MSSQL/show?time=2006-04-04+05%3A00%3A18</link>
<description>edited by AntonKovalenko</description>
</item>
</channel>
</rss>

