<?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: DB Query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/DB-Query/m-p/515455#M144730</link>
    <description>&lt;P&gt;You said this query fails&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|dbquery wmsewprd "select * from sys_code_type where rec_type='C'&lt;/LI-CODE&gt;&lt;P&gt;and this one does not&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|dbquery wmsewprd "select * from wmsew.sys_code_type where rec_type='C'&lt;/LI-CODE&gt;&lt;P&gt;So I presume you wish to refer to the sys_code_type field by that name.&amp;nbsp; You can do that, but first you must comply with the database's name rules and include the table name in the query.&amp;nbsp; After that, if necessary, you can use &lt;FONT face="courier new,courier"&gt;rename&lt;/FONT&gt; to strip out the table name from fields.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|dbquery wmsewprd "select * from wmsew.sys_code_type where rec_type='C'
| rename wmsew.* as *&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Aug 2020 13:53:06 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-08-21T13:53:06Z</dc:date>
    <item>
      <title>DB Query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/DB-Query/m-p/515115#M144603</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Can someone advice what is wrong with this&amp;nbsp; following query.&lt;/P&gt;&lt;P&gt;|dbquery wmsewprd "select * from sys_code_type where rec_type='C'" when I run this ,I get an error.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rahul2gupta_0-1597901305598.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/10397i7CC76F66E7282FCC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rahul2gupta_0-1597901305598.png" alt="rahul2gupta_0-1597901305598.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I use &lt;STRONG&gt;wmsew.sys_code_type&lt;/STRONG&gt; instead of &lt;STRONG&gt;sys_code_type&lt;/STRONG&gt; I get the exact output.Can any help me this.Our requirement is to work |dbquery wmsewprd "select * from sys_code_type where rec_type='C'" .&lt;/P&gt;&lt;P&gt;wmsewprd -- External Database.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;</description>
      <pubDate>Thu, 20 Aug 2020 05:32:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/DB-Query/m-p/515115#M144603</guid>
      <dc:creator>rahul2gupta</dc:creator>
      <dc:date>2020-08-20T05:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: DB Query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/DB-Query/m-p/515201#M144643</link>
      <description>&lt;P&gt;I don't understand why, when you know the syntax that works, you insist on using syntax that does not work.&lt;BR /&gt;If you need to use a different name later in your query then you use &lt;FONT face="courier new,courier"&gt;rename wmsew.* as *&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Aug 2020 12:44:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/DB-Query/m-p/515201#M144643</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-08-20T12:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: DB Query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/DB-Query/m-p/515406#M144711</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Could you please elaborate more about this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you need to use a different name later in your query then you use&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;rename wmsew.* as *&lt;/FONT&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Rahul&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 09:47:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/DB-Query/m-p/515406#M144711</guid>
      <dc:creator>rahul2gupta</dc:creator>
      <dc:date>2020-08-21T09:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: DB Query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/DB-Query/m-p/515455#M144730</link>
      <description>&lt;P&gt;You said this query fails&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|dbquery wmsewprd "select * from sys_code_type where rec_type='C'&lt;/LI-CODE&gt;&lt;P&gt;and this one does not&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|dbquery wmsewprd "select * from wmsew.sys_code_type where rec_type='C'&lt;/LI-CODE&gt;&lt;P&gt;So I presume you wish to refer to the sys_code_type field by that name.&amp;nbsp; You can do that, but first you must comply with the database's name rules and include the table name in the query.&amp;nbsp; After that, if necessary, you can use &lt;FONT face="courier new,courier"&gt;rename&lt;/FONT&gt; to strip out the table name from fields.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|dbquery wmsewprd "select * from wmsew.sys_code_type where rec_type='C'
| rename wmsew.* as *&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 13:53:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/DB-Query/m-p/515455#M144730</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-08-21T13:53:06Z</dc:date>
    </item>
  </channel>
</rss>

