V4.7.1 MSSQL - error status:500 Multi-part identifier could not be bound

Wappler Version : v4.7.1
Operating System : MacOS
Server Model: NodeJS
Database Type: MSSQL
Hosting Type: Local Docker

Expected behavior

  1. After adding an equal condition to filter data by a $_GET variable, the query is expected to return data if condition is met.
  2. Same error message when another table is joined to the main table (any Join type)
  3. The existing queries with the same setup are running without any error.

Actual behavior

The query fails with error status: 500. The message is as below:

select distinct [CustomerID] from [dbo].[tbl_customers] as [dbo.tbl_customers] where [dbo].[tbl_customers].[CustomerID] = @p0 - The multi-part identifier "dbo.tbl_customers.CustomerID" could not be bound.

How to reproduce

  1. Create a Multiple Records Query - Run query without adding any condition or a table join - No error message
  2. Add a condition - query fails
  3. Remove the condition and add a table join - query fails

Any help in resolving this issue is appreciated. The queries are failing with Status: 500 Error code when run with any type of a condition or a table join. In the query below, when a condition is added to check whether the status is 1 or 0, the query returns an error. If I remove the condition, query returns the data correctly.

I have found the reason why these queries are failing.

The table names are being saved with aliases. The queries will fail until aliases are removed manually for each table name including joined tables. The aliases will need to be removed manually after each save to keep the queries working correctly.

This has been fixed in Wappler 4.7.2

This topic was automatically closed after 42 hours. New replies are no longer allowed.