SQL Server query returning -1 with sqldbcode 4104
Posted on 2013-12-19
I've recently added a new query to my PowerBuilder 12.1 application which has existed (in one form or another) for over 15 years now. This is a very simple SELECT query against a very simple database table and is similar to literally hundreds of other query statements in this application. For some reason (and this is something I've never encountered before) this specific query is returning with an SQLCODE value of -1, SQLDBCODE value of 4104 and the following text:
SQLSTATE = 42S22
Microsoft SQL Server Native Client 10.0
The multi-part identifier "struct_key.etss_comp" could not be bound.
I've tried changing the field name a number of times, but the result is still the same. The only thing special about this query is that it's always the FIRST database query in the application, since I'm planning on using the results to potentially "kick-off" another application based on the values in the fields returned by this query -OR- just continue with the application which will be the case 99.9% of the time. Problem is, in order to do what I'm looking to do, I need the results from this query. Note: Running the query in SQL Server Management Studio with hard-coded values in the WHERE clause works fine!? I'm hoping one of you SQL Server gurus have run into this before and there's a simple solution. If you need any additional information, please let me know.