<?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 DBConnect and Oracle and ORA-00933: SQL command not properly ended erro in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/DBConnect-and-Oracle-and-ORA-00933-SQL-command-not-properly/m-p/61688#M855</link>
    <description>&lt;P&gt;Greetings All-&lt;BR /&gt;
Using latest DBConnect in an oracle environment. I have a query that I run and it successfully is returning data via an adhoc query. When I add this query as a input, I am getting the following:&lt;/P&gt;

&lt;P&gt;ERROR:TailDatabaseMonitor - Error while executing database monitor: java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended&lt;BR /&gt;
java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended&lt;/P&gt;

&lt;P&gt;Here is the query (data is cleansed..)&lt;/P&gt;

&lt;P&gt;SELECT a.MONTH||a.DAY AS "Call_Date",&lt;BR /&gt;
       a.XXY_ID AS "XX_Y" ,&lt;BR /&gt;
       CASE&lt;BR /&gt;
           WHEN a.DISPLY_NUMBER_FLG = '1' THEN '0' || a.disply_number&lt;BR /&gt;
           ELSE a.dis_id&lt;BR /&gt;
       END AS "Telephone_No",&lt;BR /&gt;
       a.XXXXXX_ID AS "Destination_No",&lt;BR /&gt;
       CASE&lt;BR /&gt;
           WHEN substr(a.XXXXXX_ID, 1,3) = '010' THEN NVL(b.COUNTRY_SPLITTING,' ')&lt;BR /&gt;
           ELSE ' '&lt;BR /&gt;
       END AS "Country",&lt;BR /&gt;
substr(a.TUWA_START_TIME,9,2) || ':' || substr(a.TUWA_START_TIME,11,2) || ':' || substr(a.TUWA_START_TIME,13,2) || '.' || substr(a.TUWA_START_TIME,15,1) AS "Start_Time" ,&lt;BR /&gt;
substr(a.TUWA_END_TIME,9,2) || ':' || substr(a.TUWA_END_TIME,11,2) || ':' || substr(a.TUWA_END_TIME,13,2) || '.' || substr(a.TUWA_END_TIME,15,1) AS "End_Time",&lt;BR /&gt;
CASE WHEN TUWA_TIME&amp;gt;=360000 THEN trim(to_char(floor(TUWA_TIME/3600),'000'))&lt;BR /&gt;
ELSE trim(to_char(floor(TUWA_TIME/3600),'00'))&lt;BR /&gt;
END ||':'|| trim(to_char(floor((TUWA_TIME-floor(TUWA_TIME/3600)*3600)/60),'00'))||':'|| trim(to_char(TUWA_TIME-floor(TUWA_TIME/60)*60,'00.0')) AS "Call_Time" ,&lt;BR /&gt;
'5' AS "Time_Zone",&lt;BR /&gt;
trim(to_char(a.VVVVVVVVV10,'999,999,990.99')) AS "Charges",&lt;BR /&gt;
a.TUWA_START_TIME AS "StartDateTime"&lt;BR /&gt;
FROM CDR.KVH_CALL_DATA_T a,&lt;BR /&gt;
     CDR.KVH_MDL_MASTER_T b&lt;BR /&gt;
WHERE ((a.month = '201307'&lt;BR /&gt;
        AND a.day &amp;gt;=1)&lt;BR /&gt;
       OR (a.month= '201309'&lt;BR /&gt;
           AND a.day &amp;lt;=11))&lt;BR /&gt;
AND customer_cd='1000000-000'&lt;BR /&gt;
AND a.prefix = b.code (+)&lt;BR /&gt;
AND a.y.z = b.y.z(+)&lt;BR /&gt;
AND a.except_typ = '00'&lt;BR /&gt;
AND a.VVVVVVVVV10 &amp;lt;&amp;gt; 0&lt;BR /&gt;
{{WHERE $rising_column$ &amp;gt; ?}}&lt;/P&gt;

&lt;P&gt;My $rising_column$ is set as the StartDateTime field.&lt;/P&gt;

&lt;P&gt;Going through dbx.log is pretty use..less. &lt;/P&gt;

&lt;P&gt;INFO:TailDatabaseMonitor - Applying latest tail.rising.column value=201308032333370&lt;/P&gt;

&lt;P&gt;Can see its getting the proper schema and value for the rising column. But after this it errors out with;&lt;/P&gt;

&lt;P&gt;bx8559:ERROR:TailDatabaseMonitor - Error while executing database monitor: java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended&lt;BR /&gt;
java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended&lt;BR /&gt;
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)&lt;BR /&gt;
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)&lt;BR /&gt;
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)&lt;BR /&gt;
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)&lt;BR /&gt;
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)&lt;BR /&gt;
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)&lt;BR /&gt;
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)&lt;BR /&gt;
    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)&lt;BR /&gt;
        .......&lt;/P&gt;

&lt;P&gt;Other simple queries running as inputs are working.. &lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 14:45:38 GMT</pubDate>
    <dc:creator>ericsix</dc:creator>
    <dc:date>2020-09-28T14:45:38Z</dc:date>
    <item>
      <title>DBConnect and Oracle and ORA-00933: SQL command not properly ended erro</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/DBConnect-and-Oracle-and-ORA-00933-SQL-command-not-properly/m-p/61688#M855</link>
      <description>&lt;P&gt;Greetings All-&lt;BR /&gt;
Using latest DBConnect in an oracle environment. I have a query that I run and it successfully is returning data via an adhoc query. When I add this query as a input, I am getting the following:&lt;/P&gt;

&lt;P&gt;ERROR:TailDatabaseMonitor - Error while executing database monitor: java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended&lt;BR /&gt;
java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended&lt;/P&gt;

&lt;P&gt;Here is the query (data is cleansed..)&lt;/P&gt;

&lt;P&gt;SELECT a.MONTH||a.DAY AS "Call_Date",&lt;BR /&gt;
       a.XXY_ID AS "XX_Y" ,&lt;BR /&gt;
       CASE&lt;BR /&gt;
           WHEN a.DISPLY_NUMBER_FLG = '1' THEN '0' || a.disply_number&lt;BR /&gt;
           ELSE a.dis_id&lt;BR /&gt;
       END AS "Telephone_No",&lt;BR /&gt;
       a.XXXXXX_ID AS "Destination_No",&lt;BR /&gt;
       CASE&lt;BR /&gt;
           WHEN substr(a.XXXXXX_ID, 1,3) = '010' THEN NVL(b.COUNTRY_SPLITTING,' ')&lt;BR /&gt;
           ELSE ' '&lt;BR /&gt;
       END AS "Country",&lt;BR /&gt;
substr(a.TUWA_START_TIME,9,2) || ':' || substr(a.TUWA_START_TIME,11,2) || ':' || substr(a.TUWA_START_TIME,13,2) || '.' || substr(a.TUWA_START_TIME,15,1) AS "Start_Time" ,&lt;BR /&gt;
substr(a.TUWA_END_TIME,9,2) || ':' || substr(a.TUWA_END_TIME,11,2) || ':' || substr(a.TUWA_END_TIME,13,2) || '.' || substr(a.TUWA_END_TIME,15,1) AS "End_Time",&lt;BR /&gt;
CASE WHEN TUWA_TIME&amp;gt;=360000 THEN trim(to_char(floor(TUWA_TIME/3600),'000'))&lt;BR /&gt;
ELSE trim(to_char(floor(TUWA_TIME/3600),'00'))&lt;BR /&gt;
END ||':'|| trim(to_char(floor((TUWA_TIME-floor(TUWA_TIME/3600)*3600)/60),'00'))||':'|| trim(to_char(TUWA_TIME-floor(TUWA_TIME/60)*60,'00.0')) AS "Call_Time" ,&lt;BR /&gt;
'5' AS "Time_Zone",&lt;BR /&gt;
trim(to_char(a.VVVVVVVVV10,'999,999,990.99')) AS "Charges",&lt;BR /&gt;
a.TUWA_START_TIME AS "StartDateTime"&lt;BR /&gt;
FROM CDR.KVH_CALL_DATA_T a,&lt;BR /&gt;
     CDR.KVH_MDL_MASTER_T b&lt;BR /&gt;
WHERE ((a.month = '201307'&lt;BR /&gt;
        AND a.day &amp;gt;=1)&lt;BR /&gt;
       OR (a.month= '201309'&lt;BR /&gt;
           AND a.day &amp;lt;=11))&lt;BR /&gt;
AND customer_cd='1000000-000'&lt;BR /&gt;
AND a.prefix = b.code (+)&lt;BR /&gt;
AND a.y.z = b.y.z(+)&lt;BR /&gt;
AND a.except_typ = '00'&lt;BR /&gt;
AND a.VVVVVVVVV10 &amp;lt;&amp;gt; 0&lt;BR /&gt;
{{WHERE $rising_column$ &amp;gt; ?}}&lt;/P&gt;

&lt;P&gt;My $rising_column$ is set as the StartDateTime field.&lt;/P&gt;

&lt;P&gt;Going through dbx.log is pretty use..less. &lt;/P&gt;

&lt;P&gt;INFO:TailDatabaseMonitor - Applying latest tail.rising.column value=201308032333370&lt;/P&gt;

&lt;P&gt;Can see its getting the proper schema and value for the rising column. But after this it errors out with;&lt;/P&gt;

&lt;P&gt;bx8559:ERROR:TailDatabaseMonitor - Error while executing database monitor: java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended&lt;BR /&gt;
java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended&lt;BR /&gt;
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)&lt;BR /&gt;
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)&lt;BR /&gt;
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)&lt;BR /&gt;
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)&lt;BR /&gt;
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)&lt;BR /&gt;
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)&lt;BR /&gt;
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)&lt;BR /&gt;
    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)&lt;BR /&gt;
        .......&lt;/P&gt;

&lt;P&gt;Other simple queries running as inputs are working.. &lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:45:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/DBConnect-and-Oracle-and-ORA-00933-SQL-command-not-properly/m-p/61688#M855</guid>
      <dc:creator>ericsix</dc:creator>
      <dc:date>2020-09-28T14:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: DBConnect and Oracle and ORA-00933: SQL command not properly ended erro</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/DBConnect-and-Oracle-and-ORA-00933-SQL-command-not-properly/m-p/61689#M856</link>
      <description>&lt;P&gt;Yes. The rising condition is applied incorrectly, because of the way the statement is written. It's evaluating as WHERE ... AND ... AND ... WHERE rising_condition. That's not valid SQL. Check the answer linked below for a hint; you're going to have to use "custom SQL" for your DB input, but then it should work as expected.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/98012/dbx-combining-where-in-custom-sql-with-rising-column"&gt;http://answers.splunk.com/answers/98012/dbx-combining-where-in-custom-sql-with-rising-column&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2013 14:21:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/DBConnect-and-Oracle-and-ORA-00933-SQL-command-not-properly/m-p/61689#M856</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2013-09-12T14:21:54Z</dc:date>
    </item>
  </channel>
</rss>

