<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Dynamic select statement from SQL table using SQL data source]]></title><description><![CDATA[<p dir="auto">Hi Everbody,</p>
<p dir="auto">When an event is activated, we would like to  send a message to the relevant number. Phone numbers and datasource names are stored in sql table which is more than 10.000 rows. As we see that, in order to find relevant phone number, we need to create a sql datapoint for each phone number and we don't want to create 10.000 sql datapoints.</p>
<p dir="auto">Can we change select statement  or row idenfier of sql data point dynamically??<br />
What is your suggestion?</p>
<p dir="auto">What we plan to do is in attachement.</p>
<p dir="auto">Cheers!<br />
<img src="https://camo.nodebb.org/986260958610ef18b73f87a190b2c688ba756a73?url=https%3A%2F%2Fi.imgur.com%2FcbGXOgw.png" alt="0_1583240668787_b6db6289-b4a2-4451-b507-d29d5c3803ff-image.png" class=" img-fluid img-markdown" /><br />
Re: <a href="/topic/4541/sql-data-source-is-it-possible-to-include-a-data-point-value-in-a-query">SQL Data Source - Is it possible to include a Data Point value in a query?</a></p>
]]></description><link>https://forum.mango-os.com/topic/4734/dynamic-select-statement-from-sql-table-using-sql-data-source</link><generator>RSS for Node</generator><lastBuildDate>Fri, 12 Jun 2026 12:06:42 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/4734.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 03 Mar 2020 12:49:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dynamic select statement from SQL table using SQL data source on Thu, 05 Mar 2020 01:57:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terrypacker" aria-label="Profile: terrypacker">@<bdi>terrypacker</bdi></a> said in <a href="/post/24870">Dynamic select statement from SQL table using SQL data source</a>:</p>
<blockquote>
<p dir="auto">As a side note Mango 4.0 will have a Message event handler that will allow using Twilio and in the future other platforms to send messages.</p>
</blockquote>
<p dir="auto">I've been wanting to do this!<br />
Thanks Terry!</p>
]]></description><link>https://forum.mango-os.com/post/24871</link><guid isPermaLink="true">https://forum.mango-os.com/post/24871</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Thu, 05 Mar 2020 01:57:27 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic select statement from SQL table using SQL data source on Thu, 05 Mar 2020 01:55:58 GMT]]></title><description><![CDATA[<p dir="auto">@Nurr</p>
<p dir="auto">There is the possibility to use the Email Event handler to do this.  If you return "CANCEL" from the script on an email event handler it won't actually send an email.  Leveraging this one could write a script to make an SQL query for the numbers and then call your global script.  You can call Java code directly from the script but it will require some knowledge of Java and how to use it within the Nashorn Javascript Engine.  There should be some examples of this on our forum.  Basically the script needs superadmin permission and you must use the full package and class name when you reference a Java class.</p>
<p dir="auto">If you are game to give it a try, here is some documentation on the SQL api for Java:<br />
<a href="https://docs.oracle.com/javase/tutorial/jdbc/basics/processingsqlstatements.html" rel="nofollow ugc">https://docs.oracle.com/javase/tutorial/jdbc/basics/processingsqlstatements.html</a></p>
<p dir="auto">As a side note Mango 4.0 will have a Message event handler that will allow using Twilio and in the future other platforms to send messages.</p>
]]></description><link>https://forum.mango-os.com/post/24870</link><guid isPermaLink="true">https://forum.mango-os.com/post/24870</guid><dc:creator><![CDATA[terrypacker]]></dc:creator><pubDate>Thu, 05 Mar 2020 01:55:58 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamic select statement from SQL table using SQL data source on Tue, 03 Mar 2020 20:35:40 GMT]]></title><description><![CDATA[<p dir="auto">Given what you are trying to do, I wouldn't bother doing it in Mango.<br />
I'd use an http server to post the info to and use that to look up the SQL server and call the message app service.<br />
Rather than trying to make Mango do awkward maneuvers for a simple task, perhaps some simple tasks combined would be easier... just leverage a system designed to handle it.</p>
<p dir="auto">I wouldn't bother fluffing with the sql datasource, I think it's a run and select data affair from what I've seen.</p>
]]></description><link>https://forum.mango-os.com/post/24856</link><guid isPermaLink="true">https://forum.mango-os.com/post/24856</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 03 Mar 2020 20:35:40 GMT</pubDate></item></channel></rss>