<?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: Splunk DB Connect 1: How do you get dbquery to recognize applied field names in a SQL SELECT statement where there is no transform command like COUNT or SUM? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-1-How-do-you-get-dbquery-to-recognize-applied/m-p/232441#M73598</link>
    <description>&lt;P&gt;There is a bug?  Maybe just "unintended feature?" of dbconnect that it doesn't seem to honor aliases unless certain hoops have been jumped through.  So, in your case, fake it out with easy hoops.  One of the more common methods is to cast them all to character strings, like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SELECT DATE(reportdate) AS reportdate, CAST(description AS CHAR(64)) AS Description....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And so on.&lt;/P&gt;</description>
    <pubDate>Thu, 05 May 2016 23:55:20 GMT</pubDate>
    <dc:creator>Richfez</dc:creator>
    <dc:date>2016-05-05T23:55:20Z</dc:date>
    <item>
      <title>Splunk DB Connect 1: How do you get dbquery to recognize applied field names in a SQL SELECT statement where there is no transform command like COUNT or SUM?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-1-How-do-you-get-dbquery-to-recognize-applied/m-p/232440#M73597</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Issue:&lt;/STRONG&gt;&lt;BR /&gt;
Renaming a field in SQL that is not transformed in some way (transformations: COUNT() AS  or SUM() AS , etc.) will leave the field named as it is in the table, making the addition of multiple fields with the same name from different tables impossible.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbquery TEST " 
SELECT DATE(ab.reportdate) AS reportdate, ab.name AS device_A, cd.name AS device_B, cd.deviceid, 
FROM testing 
JOIN application.devicetype as cd ON ab.deviceid = cd.deviceid
....;"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this example, the field &lt;STRONG&gt;ab.name&lt;/STRONG&gt; will show up in the results as &lt;STRONG&gt;name&lt;/STRONG&gt; not under the new name &lt;STRONG&gt;device_A&lt;/STRONG&gt; and &lt;STRONG&gt;cd.name&lt;/STRONG&gt; won't show up at all as the 'name' column already exists.&lt;/P&gt;

&lt;P&gt;Question:&lt;BR /&gt;
How do you get dbquery to recognize applied field names in a SELECT statement where there is not a transform command like COUNT or SUM?&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 21:56:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-1-How-do-you-get-dbquery-to-recognize-applied/m-p/232440#M73597</guid>
      <dc:creator>pepper_seattle</dc:creator>
      <dc:date>2016-05-05T21:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect 1: How do you get dbquery to recognize applied field names in a SQL SELECT statement where there is no transform command like COUNT or SUM?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-1-How-do-you-get-dbquery-to-recognize-applied/m-p/232441#M73598</link>
      <description>&lt;P&gt;There is a bug?  Maybe just "unintended feature?" of dbconnect that it doesn't seem to honor aliases unless certain hoops have been jumped through.  So, in your case, fake it out with easy hoops.  One of the more common methods is to cast them all to character strings, like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SELECT DATE(reportdate) AS reportdate, CAST(description AS CHAR(64)) AS Description....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And so on.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 23:55:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-1-How-do-you-get-dbquery-to-recognize-applied/m-p/232441#M73598</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-05-05T23:55:20Z</dc:date>
    </item>
  </channel>
</rss>

