You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a bind variable ('?') is inserted into the correlated sub-query, it will fail. For example:
select * from booksales as b1 where price in (select max(price) from booksales where b1.customer_id = customer_id and book_id <> ?)
The way that correlated sub-queries were solved was by inserting a bind variable for every outer table field reference in the inner query. This needs to be resolved.
The text was updated successfully, but these errors were encountered:
The fix will involve changing how SELECT statements will reference the bind variables.
Current use has the '?' in the SELECT matching bind data in the order listed in the gsSQL() function.
The bind variable will be changed so that the bind ? will use a specific variable in the list. This will be done by also including the position number on the bind variable.
The added benefit to this is when one bind data point is needed more than once in the SELECT statement. Currently, you would have to add the bind data as many times as needed in the select.
The new format will be like:
=gsSQL("select * from table where fldName = ?1 and amountFld < ?2 and otherAmount > ?2", {{"table", "A1:I20", 60}}, true, "Fred", 100)
You can see in this example, we would only need to list TWO bind data items since we can reference one bind data point more than once, where the current use would require 3 bind data items.
The ?1 would reference the first bind data point listed and ?2 would reference the second.
The text was updated successfully, but these errors were encountered: