<?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 External search command 'dbquery' returned error code 1. Script output = 'There is no such database [stt-dw] available for this user!' in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/External-search-command-dbquery-returned-error-code-1-Script/m-p/153467#M185619</link>
    <description>&lt;P&gt;I have a search which does a basic query to a database using dbquery. I have a user which has a role assigned to it and this role has been given read/write permission to DB Connect and the database. The role also has the capabilites "dbx_capable" and "schedule_rtsearch". However, when running the search, I got the external command error as stated in the title of this question.&lt;/P&gt;

&lt;P&gt;The weird thing is that if I add the role "dbx_user" as an inherited role to the role assigned to this user, the search works. The dbx_user role has only the two capabilites "dbx_capable" and "schedule_rtsearch and read/write permission to DB Connect and the database.&lt;/P&gt;

&lt;P&gt;I don't understand why the role I created doesn't work since it has the same permissions as the dbx_user role.&lt;/P&gt;

&lt;P&gt;Can someone please advise? Thanks.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Jackie&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 18:24:11 GMT</pubDate>
    <dc:creator>jackiewkc</dc:creator>
    <dc:date>2020-09-28T18:24:11Z</dc:date>
    <item>
      <title>External search command 'dbquery' returned error code 1. Script output = 'There is no such database [stt-dw] available for this user!'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/External-search-command-dbquery-returned-error-code-1-Script/m-p/153467#M185619</link>
      <description>&lt;P&gt;I have a search which does a basic query to a database using dbquery. I have a user which has a role assigned to it and this role has been given read/write permission to DB Connect and the database. The role also has the capabilites "dbx_capable" and "schedule_rtsearch". However, when running the search, I got the external command error as stated in the title of this question.&lt;/P&gt;

&lt;P&gt;The weird thing is that if I add the role "dbx_user" as an inherited role to the role assigned to this user, the search works. The dbx_user role has only the two capabilites "dbx_capable" and "schedule_rtsearch and read/write permission to DB Connect and the database.&lt;/P&gt;

&lt;P&gt;I don't understand why the role I created doesn't work since it has the same permissions as the dbx_user role.&lt;/P&gt;

&lt;P&gt;Can someone please advise? Thanks.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Jackie&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:24:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/External-search-command-dbquery-returned-error-code-1-Script/m-p/153467#M185619</guid>
      <dc:creator>jackiewkc</dc:creator>
      <dc:date>2020-09-28T18:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: External search command 'dbquery' returned error code 1. Script output = 'There is no such database [stt-dw] available for this user!'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/External-search-command-dbquery-returned-error-code-1-Script/m-p/153468#M185620</link>
      <description>&lt;P&gt;I encountered a similar error while running the below query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Select count(Field) from Table
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The error was:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;External search command 'dbxquery' returned error code 1. Script output = " ERROR "Exception at ""/opt/splunk/etc/apps/splunk_app_db_connect/bin/dbxquery.py"", line 123 : com.microsoft.sqlserver.jdbc.SQLServerException: No column name was specified for column 1 of 't'.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I changed the query to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Select count(Field) as count_Field from Table
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This resolved the issue. Thought I'd share this.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 00:15:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/External-search-command-dbquery-returned-error-code-1-Script/m-p/153468#M185620</guid>
      <dc:creator>tahakhan</dc:creator>
      <dc:date>2016-02-26T00:15:35Z</dc:date>
    </item>
  </channel>
</rss>

