<?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 Bugs with text query parameters? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/bugs-with-text-query-parameters/m-p/10153#M5396</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have query with a handful of text query parameters, I need to use to insert data into a table from a dashboard e.g.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INSERT INTO user_data (first_name, middle_name, last_name, city, country, zip_code) VALUES ('{{first_name}}', '{{middle_name}}', '{{last_name}}', '{{city}}', '{{country}}', '{{zip_code}}')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am having all sorts of issues with running the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly, the 'middle_name' parameter is optional and can be empty. Databricks returns a 'Missing value for middle_name' if this is empty. It just would not run the query. I was expecting the parameter value to come as NULL or as an empty string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second issue, Databricks is appending additional quote marks around the value for the last_name parameter. For example, if I enter Smith in that field the query fails because it looks like below. I get an error about 'Smith':&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INSERT INTO user_data (first_name, middle_name, last_name, city, country, zip_code) VALUES ('John', 'X', ''Smith'', 'Cyberia', 'Internet', '999999')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I've had to remove the quote around the last_name parameter just to get the query working, so it now looks like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INSERT INTO user_data (first_name, middle_name, last_name, city, country, zip_code) VALUES ('{{first_name}}', '{{middle_name}}', {{last_name}}, '{{city}}', '{{country}}', '{{zip_code}}')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Both issues make it tricky to hand dashboards over to users who are keen to use the product. The second issue is more worrying. The backend seems to have picked a field at random to append extra quotation marks to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help or work-around for both issues would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Feb 2023 17:22:50 GMT</pubDate>
    <dc:creator>desert_safari</dc:creator>
    <dc:date>2023-02-02T17:22:50Z</dc:date>
    <item>
      <title>Bugs with text query parameters?</title>
      <link>https://community.databricks.com/t5/data-engineering/bugs-with-text-query-parameters/m-p/10153#M5396</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have query with a handful of text query parameters, I need to use to insert data into a table from a dashboard e.g.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INSERT INTO user_data (first_name, middle_name, last_name, city, country, zip_code) VALUES ('{{first_name}}', '{{middle_name}}', '{{last_name}}', '{{city}}', '{{country}}', '{{zip_code}}')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am having all sorts of issues with running the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly, the 'middle_name' parameter is optional and can be empty. Databricks returns a 'Missing value for middle_name' if this is empty. It just would not run the query. I was expecting the parameter value to come as NULL or as an empty string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second issue, Databricks is appending additional quote marks around the value for the last_name parameter. For example, if I enter Smith in that field the query fails because it looks like below. I get an error about 'Smith':&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INSERT INTO user_data (first_name, middle_name, last_name, city, country, zip_code) VALUES ('John', 'X', ''Smith'', 'Cyberia', 'Internet', '999999')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I've had to remove the quote around the last_name parameter just to get the query working, so it now looks like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;INSERT INTO user_data (first_name, middle_name, last_name, city, country, zip_code) VALUES ('{{first_name}}', '{{middle_name}}', {{last_name}}, '{{city}}', '{{country}}', '{{zip_code}}')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Both issues make it tricky to hand dashboards over to users who are keen to use the product. The second issue is more worrying. The backend seems to have picked a field at random to append extra quotation marks to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help or work-around for both issues would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 17:22:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/bugs-with-text-query-parameters/m-p/10153#M5396</guid>
      <dc:creator>desert_safari</dc:creator>
      <dc:date>2023-02-02T17:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Bugs with text query parameters?</title>
      <link>https://community.databricks.com/t5/data-engineering/bugs-with-text-query-parameters/m-p/10155#M5398</link>
      <description>&lt;P&gt;Sorry my client wants all 3 fields. The middle name has to be there. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a few cases where people have just one name.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 16:33:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/bugs-with-text-query-parameters/m-p/10155#M5398</guid>
      <dc:creator>desert_safari</dc:creator>
      <dc:date>2023-02-10T16:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Bugs with text query parameters?</title>
      <link>https://community.databricks.com/t5/data-engineering/bugs-with-text-query-parameters/m-p/10154#M5397</link>
      <description>&lt;P&gt;Hi, what if , if you use only first name and last name, eliminating the middle name? Also, please refer to &lt;A href="https://docs.databricks.com/sql/language-manual/sql-ref-syntax-dml-insert-into.html" alt="https://docs.databricks.com/sql/language-manual/sql-ref-syntax-dml-insert-into.html" target="_blank"&gt;https://docs.databricks.com/sql/language-manual/sql-ref-syntax-dml-insert-into.html&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 05:06:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/bugs-with-text-query-parameters/m-p/10154#M5397</guid>
      <dc:creator>Debayan</dc:creator>
      <dc:date>2023-02-07T05:06:44Z</dc:date>
    </item>
  </channel>
</rss>

