Announcement

Collapse
No announcement yet.

8.0032 - SQL interpretation is broken

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 8.0032 - SQL interpretation is broken

    ScriptCase interprets SQL incorrectly.

    Create a grid application with nested SQL:
    Code:
    SELECT t0.Item_Name, (SELECT AVG(Price) FROM t_inventory WHERE id = t0.iid) AS aprice FROM items t0
    The SC SelectLimit() function will have an error in the order-by parameter: "nm_sel_esp order by Item_Name asc, 12, 0"

    1. ScriptCase should not add an ORDER BY clause
    2. If a field was defined using an explicit table reference, that table reference is required (not optional)

    The full error will be:
    Code:
    Error
    Error while accessing the database:
    Unknown column 'Item_Name' in 'order clause'
    SelectLimit(SELECT t0.Item_Name, (SELECT AVG(Price) FROM t_inventory WHERE id = t0.iid) AS aprice FROM items t0 ) nm_sel_esp order by Item_Name asc, 12, 0)
    The workaround is to create a VIEW, but if you must interpret the SQL, then you should interpret it correctly, and not add arbitrary clauses like ORDER BY.
Working...
X