<?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: How to pass variables into query string? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-pass-variables-into-query-string/m-p/23388#M16133</link>
    <description>&lt;P&gt;@Srinivas Gannavaram​&amp;nbsp;, in python:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;spark.sql(f"""
SELECT
   CI.CORPORATE_ITEM_INTEGRATION_ID , 
   CI.CORPORATE_ITEM_CD 
WHERE
   CI.DW_CREATE_TS &amp;lt; '{my_timestamp_variable}' ;
""")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Apr 2022 13:05:46 GMT</pubDate>
    <dc:creator>Hubert-Dudek</dc:creator>
    <dc:date>2022-04-07T13:05:46Z</dc:date>
    <item>
      <title>How to pass variables into query string?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-pass-variables-into-query-string/m-p/23387#M16132</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two variables StartTimeStmp and EndTimeStmp, i am going to assign the Start timestamp to it based on Last Successful Job Runtime and EndTimeStamp would be current time of system.&lt;/P&gt;&lt;P&gt;SET StartTimeStmp = '2022-03-24 15:40:00.000';&lt;/P&gt;&lt;P&gt;SET EndTimeStmp = '2022-03-24 20:00:00.000';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to pass these two variables to Query String defined in a cell. How to pass these Values.  The following is not a complete Query. Just snippet of query. &lt;/P&gt;&lt;P&gt;qrystr=('''&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM (&lt;/P&gt;&lt;P&gt;SELECT&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;CI.CORPORATE_ITEM_INTEGRATION_ID , CI.CORPORATE_ITEM_CD where CI.DW_CREATE_TS &amp;lt; '2022-02-23 20:00:00.000'&amp;nbsp; )&amp;nbsp;''')&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 12:53:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-pass-variables-into-query-string/m-p/23387#M16132</guid>
      <dc:creator>sgannavaram</dc:creator>
      <dc:date>2022-04-07T12:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass variables into query string?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-pass-variables-into-query-string/m-p/23388#M16133</link>
      <description>&lt;P&gt;@Srinivas Gannavaram​&amp;nbsp;, in python:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;spark.sql(f"""
SELECT
   CI.CORPORATE_ITEM_INTEGRATION_ID , 
   CI.CORPORATE_ITEM_CD 
WHERE
   CI.DW_CREATE_TS &amp;lt; '{my_timestamp_variable}' ;
""")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 13:05:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-pass-variables-into-query-string/m-p/23388#M16133</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-04-07T13:05:46Z</dc:date>
    </item>
  </channel>
</rss>

