<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Query database dynamic table name</title><link>https://community.appian.com/discussions/f/process/38764/query-database-dynamic-table-name</link><description>Hi all, 
 I&amp;#39;m curre ntly designing a post-deployment process and I need to be able to query database tables dynamically based on the application being deployed. I’ve tried using the Query Database smart service with variables such as ac!table , but I</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Query database dynamic table name</title><link>https://community.appian.com/thread/151805?ContentTypeID=1</link><pubDate>Mon, 29 Sep 2025 19:59:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1557eeb9-df68-46eb-b084-792148b68021</guid><dc:creator>Chaitanya Teja</dc:creator><description>&lt;p&gt;I had a similar requirement to dynamically pass the column name, table name, and primary key as parameters. Since Appian doesn&amp;#39;t support dynamic queries, I am planning to create a stored procedure in the database to handle this and use Execute stored procedure smart service instead of Query database. The procedure will accept these parameters and return the required result.&lt;/p&gt;
&lt;p&gt;However, I am also exploring the possibility of achieving this using a query entity or query record.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Query database dynamic table name</title><link>https://community.appian.com/thread/146511?ContentTypeID=1</link><pubDate>Mon, 24 Mar 2025 21:33:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:12011060-6f25-4fb3-af65-68ca439e2638</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;Pretty sure you can&amp;#39;t do that since Appian uses prepared statements to prevent SQL injection. Your best best is probably to implement a Stored Procedure.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Query database dynamic table name</title><link>https://community.appian.com/thread/146503?ContentTypeID=1</link><pubDate>Mon, 24 Mar 2025 16:08:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3f1e0356-71e7-4c7f-9d33-70c76a03d0dd</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;What&amp;#39;s your use case, specifically?&lt;/p&gt;
&lt;p&gt;The QDB node is, by everything I can tell, ancient, and its funcitonality is extraordinarily clunky - I recommend that its use be extremely limited, if it&amp;#39;s even used at all.&amp;nbsp; As you&amp;#39;ve seen, there are hidden and (afaik) undocumented syntactical limitations to exactly how variables can be used in it, and when and where.&amp;nbsp; If at all possible you should look into using Query Entity - depending on the nature of the different tables / data store entities you need to query, a single expression rule could probably handle deciding which table to query and return data to your process.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>