TIBCO Scribe Insight: Native SQL Query throwing an error or not returning any results when testing in the Workbench

TIBCO Scribe Insight: Native SQL Query throwing an error or not returning any results when testing in the Workbench

book

Article ID: KB0078186

calendar_today

Updated On:

Products Versions
TIBCO Scribe Insight All

Description

When working with SQL queries in the workbench and testing the connection you may see some strange issues such as an error regarding improper syntax, unable to to get field information, or it tests successfully but nothing shows up in the source:

 Error getting field information for Query 1. or [42S22] SQL call failed. Invalid column name 'id'. Invalid column name 'Name'. Statement(s) could not be prepared. Below is an example using a very simple query that I had created against one of my test databases. The first screenshot will show the query executing correctly and the second one shows an error message when attempting to test it in my source configuration: kA20e000000fxTJCAY_en_US_1_0 kA20e000000fxTJCAY_en_US_1_1 If you are seeing behavior with an SQL query or any connection where field information or an error is thrown. Try turning on tracing in the workbench: kA20e000000fxTJCAY_en_US_1_2 kA20e000000fxTJCAY_en_US_1_3 After you have turned on tracing at the location that is specified a file called TWorkbench.log file will be outputted and when you attempt to test the query it will output the results and format of the query: kA20e000000fxTJCAY_en_US_1_4 In here you can see the exact format that we are passing the query to SQL to SQL if you copy it into SQL Management Studio you get this: kA20e000000fxTJCAY_en_US_1_5 As you can see from the image the issue with my query is my comment. Because we need to pass the query to SQL in a single line block text format, using the -- single line comment, will comment out the rest of my statement. If I change this to a /*  */ multi-line comment the issue will go away because it has a forced end to the comment. This is a simple example of how to find information using tracing to solve an a problem. Generally tracing in insight can tell you a lot about the information that is being picked up and passed over to the target system and what steps it is going through during the process. This can also provide information as to what is occurring when attempting to create a connection but you are getting an error when doing so. Just as a note with error messages when only report what is given to us by the endpoint, sometimes additional tracing will be required on the system you are connecting into in order to capture the full error message. 

Environment

TIBCO Scribe Insight

Issue/Introduction

Sometimes you may see some strange behavior in TIBCO Scribe Insight when running SQL queries