Products | Versions |
---|---|
TIBCO Scribe Insight | All |
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:![]()
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:
![]()
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:
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:
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.