<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Passing Parameters to SQL Queries - AugSQL				            </title>
            <link>https://www.augforums.com/forums/augsql/passing-parameters-to-sql-queries/</link>
            <description>Acumatica User Group Forums</description>
            <language>en-US</language>
            <lastBuildDate>Fri, 06 Mar 2026 03:19:20 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Passing Parameters to SQL Queries</title>
                        <link>https://www.augforums.com/forums/augsql/passing-parameters-to-sql-queries/#post-10791</link>
                        <pubDate>Mon, 17 Jul 2023 03:37:33 +0000</pubDate>
                        <description><![CDATA[This idea would depend on the completion of this Saved SQL Queries idea:
 
Currently, in the SQL Command field on the AugSQL (QQ900001) screen, you can use SQL like this:
DECLARE @MyParam...]]></description>
                        <content:encoded><![CDATA[<p>This idea would depend on the completion of this Saved SQL Queries idea:</p>
<p><a href="https://www.augforums.com/forums/augsql/saved-sql-queries">https://www.augforums.com/forums/augsql/saved-sql-queries</a></p>
<p> </p>
<p>Currently, in the <span style="text-decoration: underline">SQL Command</span> field on the <span style="text-decoration: underline">AugSQL (QQ900001)</span> screen, you can use SQL like this:</p>
<pre contenteditable="false">DECLARE @MyParam1 VARCHAR(20)
SET @MyParam1='AACUSTOMER'
DECLARE @MyParam2 VARCHAR(20)
SET @MyParam2='ABARTENDE'
SELECT AcctCD, AcctName
FROM BAccount
WHERE CompanyID=2 AND AcctCD IN (@MyParam1,@MyParam2)</pre>
<p> </p>
<p>Which returns results like this:</p>
3234
<p> </p>
<p>What if you put the SQL Code above in the <span style="text-decoration: underline">SQL Command</span> field on the <span style="text-decoration: underline">AugSQL Saved Queries (QQ900003)</span><span> screen and save it.</span></p>
<p>Then, what if you could populate the @MyParam1 and @MyParam2 values at runtime in the URL. There would also need to be a parameter that tells the query to run. Maybe something like this:</p>
<p><span style="text-decoration: underline">https://mycompany.acumatica.com/Main?CompanyID=SalesDemo&amp;ScreenId=QQ900003&amp;Action=RunQuery&amp;MyParam1=MyValue1&amp;MyParam2=MyValue2</span></p>
<p> </p>
<p>That would be interesting. Actually, that would change my approach to the <strong><a href="https://www.augforums.com/forums/augsql/scheduled-queries/" target="_blank" rel="noopener">Schedule Queries Idea (click here)</a></strong> so I'm going to add to that Discussion with another idea.</p>]]></content:encoded>
						                            <category domain="https://www.augforums.com/forums/augsql/">AugSQL</category>                        <dc:creator>Tim Rodman</dc:creator>
                        <guid isPermaLink="true">https://www.augforums.com/forums/augsql/passing-parameters-to-sql-queries/#post-10791</guid>
                    </item>
							        </channel>
        </rss>
		