<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RE: Syntax for Dynamic SQL query with Excel in University Forum</title>
    <link>https://community.blueprism.com/t5/University-Forum/Syntax-for-Dynamic-SQL-query-with-Excel/m-p/81845#M1028</link>
    <description>Hi Sapna,&lt;BR /&gt;&lt;BR /&gt;It's a case of simple concatenation, replacing your hard coded values with the name of the data item containing the value. You would use the Concatenate (&amp;amp;) to string the SQL query and the data items together.&lt;BR /&gt;&lt;BR /&gt;Take a look at the 'Blue Prism Guide to OLEDB' which is available on the Blue Prism University. Just perform a search to locate the training course. On page 4, there is an example of using data items in an SQL statement.&lt;BR /&gt;&lt;BR /&gt;Here is an example using one of your scenarios.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt;"2. Select [Borrower Fullname] from [ACBS_SET_IDSA_CVS20200407$] where [Loan Number]='123456'&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN style="color: #3366ff;"&gt;In this query, &amp;nbsp;I want to replace the loan no. 123456 with some data type– Data1, which will store dynamic values. How do we do that."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;STRONG&gt;This is assuming that the Loan Number field is a text value:&lt;/STRONG&gt;&lt;BR /&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="32505.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/32608iA2BED85B08F7DD3F/image-size/large?v=v2&amp;amp;px=999" role="button" title="32505.png" alt="32505.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;BR /&gt;Hope this helps!&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Carl Carter&lt;BR /&gt;Developer Program Manager&lt;BR /&gt;Blue Prism&lt;BR /&gt;Europe/London&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
    <pubDate>Thu, 07 May 2020 06:47:00 GMT</pubDate>
    <dc:creator>Carl__Carter</dc:creator>
    <dc:date>2020-05-07T06:47:00Z</dc:date>
    <item>
      <title>Syntax for Dynamic SQL query with Excel</title>
      <link>https://community.blueprism.com/t5/University-Forum/Syntax-for-Dynamic-SQL-query-with-Excel/m-p/81844#M1027</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I am looking to syntax for&amp;nbsp; basic SQL queries for making it dynamic. I have my data in excel on which i am using oledb. please help me know how to convert the hard coded values into generic syntax on below queries -&lt;BR /&gt;&lt;BR /&gt;1.Select [Loan Number],[Borrower Fullname] from [ACBS_SET_IDSA_CVS20200407$]&lt;BR /&gt;&lt;BR /&gt;
&lt;P&gt;In this query, ACBS_SET_IDSA_CVS20200407 is my sheet name. How to pass a data type if &amp;nbsp;this sheet name is &amp;nbsp;store in Data1&lt;BR /&gt;&lt;BR /&gt;2. Select [Borrower Fullname] from [ACBS_SET_IDSA_CVS20200407$] where [Loan Number]='123456'&lt;BR /&gt;&lt;BR /&gt;In this query, &amp;nbsp;I want to replace the loan no. 123456 with some data type– Data1, which will store dynamic values. How do we do that.&lt;BR /&gt;&lt;BR /&gt;3.Select distinct [Borrower Fullname] from [ACBS_SET_IDSA_CVS20200407$] where [Borrower Fullname] like '%WEST%'&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;I want to pass WEST into a data type. What will be the syntax.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;sapna soni&lt;BR /&gt;.&lt;BR /&gt;Capgemini Pvt Ltd&lt;BR /&gt;Asia/Kolkata&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 06 May 2020 12:47:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/Syntax-for-Dynamic-SQL-query-with-Excel/m-p/81844#M1027</guid>
      <dc:creator>sapna_soni0290</dc:creator>
      <dc:date>2020-05-06T12:47:00Z</dc:date>
    </item>
    <item>
      <title>RE: Syntax for Dynamic SQL query with Excel</title>
      <link>https://community.blueprism.com/t5/University-Forum/Syntax-for-Dynamic-SQL-query-with-Excel/m-p/81845#M1028</link>
      <description>Hi Sapna,&lt;BR /&gt;&lt;BR /&gt;It's a case of simple concatenation, replacing your hard coded values with the name of the data item containing the value. You would use the Concatenate (&amp;amp;) to string the SQL query and the data items together.&lt;BR /&gt;&lt;BR /&gt;Take a look at the 'Blue Prism Guide to OLEDB' which is available on the Blue Prism University. Just perform a search to locate the training course. On page 4, there is an example of using data items in an SQL statement.&lt;BR /&gt;&lt;BR /&gt;Here is an example using one of your scenarios.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;EM&gt;"2. Select [Borrower Fullname] from [ACBS_SET_IDSA_CVS20200407$] where [Loan Number]='123456'&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;&lt;SPAN style="color: #3366ff;"&gt;In this query, &amp;nbsp;I want to replace the loan no. 123456 with some data type– Data1, which will store dynamic values. How do we do that."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;STRONG&gt;This is assuming that the Loan Number field is a text value:&lt;/STRONG&gt;&lt;BR /&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="32505.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/32608iA2BED85B08F7DD3F/image-size/large?v=v2&amp;amp;px=999" role="button" title="32505.png" alt="32505.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;BR /&gt;Hope this helps!&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Carl Carter&lt;BR /&gt;Developer Program Manager&lt;BR /&gt;Blue Prism&lt;BR /&gt;Europe/London&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 07 May 2020 06:47:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/Syntax-for-Dynamic-SQL-query-with-Excel/m-p/81845#M1028</guid>
      <dc:creator>Carl__Carter</dc:creator>
      <dc:date>2020-05-07T06:47:00Z</dc:date>
    </item>
    <item>
      <title>RE: Syntax for Dynamic SQL query with Excel</title>
      <link>https://community.blueprism.com/t5/University-Forum/Syntax-for-Dynamic-SQL-query-with-Excel/m-p/81846#M1029</link>
      <description>HI Carl,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply.&lt;BR /&gt;&lt;BR /&gt;These concatenated query works if i am passing the whole query as text (within "")&amp;nbsp; as input parameter directly to the get collection action of oledb. But i want to store these queries into different data items, so i can create a&amp;nbsp; single reusable page for all these queries &amp;amp; just pass the query as input parameter of my page.&lt;BR /&gt;&lt;BR /&gt;Is there a way to achieve so.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;sapna soni&lt;BR /&gt;.&lt;BR /&gt;Capgemini Pvt Ltd&lt;BR /&gt;Asia/Kolkata&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 07 May 2020 07:06:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/Syntax-for-Dynamic-SQL-query-with-Excel/m-p/81846#M1029</guid>
      <dc:creator>sapna_soni0290</dc:creator>
      <dc:date>2020-05-07T07:06:00Z</dc:date>
    </item>
    <item>
      <title>RE: Syntax for Dynamic SQL query with Excel</title>
      <link>https://community.blueprism.com/t5/University-Forum/Syntax-for-Dynamic-SQL-query-with-Excel/m-p/81847#M1030</link>
      <description>Hi Sapna,&lt;BR /&gt;&lt;BR /&gt;That is exactly what the Calculation Stage image I included is doing. I've expanded the screenshot so you can see this:
&lt;DIV class="media" style="overflow: hidden;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="32509.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/32612iF6251C610DA2E912/image-size/large?v=v2&amp;amp;px=999" role="button" title="32509.png" alt="32509.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;BR /&gt;My SQL query is stored in the&amp;nbsp;&lt;SPAN style="color: #ff00ff;"&gt;[SQL Query]&lt;/SPAN&gt; Data Item, and this Data Item is used as the SQL input for the &lt;SPAN style="color: #0000ff;"&gt;'Data - OLEDB - Execute'&lt;/SPAN&gt;&amp;nbsp;Action.&lt;BR /&gt;&lt;BR /&gt;If you want to store your SQL query as a template in a Data Item and then update another Data item with the query to execute using another value in the process, you would use the Replace function which would replace some placeholder text. For example&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff00ff;"&gt;[SQL Query Template]&lt;/SPAN&gt; Data Item value is &lt;SPAN style="color: #339966;"&gt;"&lt;EM&gt;SELECT [Borrower Fullname] FROM [ACBS_SET_IDSA_CVS20200407$] WHERE [Loan Number]='{{Placeholder:LoanNumber}}'"&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;SPAN style="color: #ff00ff;"&gt;[Loan Number]&lt;/SPAN&gt; Data Item value is 123456&lt;BR /&gt;&lt;BR /&gt;You calculation stage to set the &lt;SPAN style="color: #ff00ff;"&gt;[SQL Query]&lt;/SPAN&gt; Data Item would look like:&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV class="media" style="overflow: hidden; zoom: 1;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="32510.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/32613i57CC86088BC792BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="32510.png" alt="32510.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff00ff;"&gt;[SQL Query]&lt;/SPAN&gt; is then used as your OLEDB query input.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Carl Carter&lt;BR /&gt;Developer Program Manager&lt;BR /&gt;Blue Prism&lt;BR /&gt;Europe/London&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 07 May 2020 07:18:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/Syntax-for-Dynamic-SQL-query-with-Excel/m-p/81847#M1030</guid>
      <dc:creator>Carl__Carter</dc:creator>
      <dc:date>2020-05-07T07:18:00Z</dc:date>
    </item>
    <item>
      <title>RE: Syntax for Dynamic SQL query with Excel</title>
      <link>https://community.blueprism.com/t5/University-Forum/Syntax-for-Dynamic-SQL-query-with-Excel/m-p/81848#M1031</link>
      <description>Hi Carl,&lt;BR /&gt;&lt;BR /&gt;Yes this helps. This helps me to achieve&amp;nbsp; the required task. Thanks a lot for help.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;sapna soni&lt;BR /&gt;.&lt;BR /&gt;Capgemini Pvt Ltd&lt;BR /&gt;Asia/Kolkata&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 07 May 2020 09:57:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/University-Forum/Syntax-for-Dynamic-SQL-query-with-Excel/m-p/81848#M1031</guid>
      <dc:creator>sapna_soni0290</dc:creator>
      <dc:date>2020-05-07T09:57:00Z</dc:date>
    </item>
  </channel>
</rss>

