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
With the code below: runUpdate $ update ordersT (\order -> [_orderAmount order <-. (_orderAmount order *100)]) (\order -> _orderTakenBy order ==. (pk tomJones))
It shows the error:
Error: * Couldn't match type QField s Scientific' with QGenExpr QValueContext FirebirdExpressionSyntax s Scientific'
Expected type: QExpr FirebirdExpressionSyntax s Scientific
Actual type: Columnar (QField s) Scientific
In the first argument of (*)', namely _orderAmount order'
In the second argument of (<-.)', namely (_orderAmount order * 100)'
In the expression:
_orderAmount order <-. (_orderAmount order * 100)
Relevant bindings include
order :: OrderT (QField s) (bound at example\EmployeesFB.hs:211:19)
The text was updated successfully, but these errors were encountered:
The problem here is that order in the second argument to update is parameterized over QField, which is conceptually the type of expressions on the 'left-hand side' of the UPDATE ... SET ... assignments. However, you want to use it as both a QField and QExpr -- this is a case I hadn't thought of, but ought to be supported.
We could pass in two tables to the second argument of update (one QField and one QExpr), but then the syntax becomes awkward and obtuse.
With the code below:
runUpdate $ update ordersT (\order -> [_orderAmount order <-. (_orderAmount order *100)]) (\order -> _orderTakenBy order ==. (pk tomJones))
It shows the error:
Error: * Couldn't match type
QField s Scientific' with
QGenExpr QValueContext FirebirdExpressionSyntax s Scientific'Expected type: QExpr FirebirdExpressionSyntax s Scientific
Actual type: Columnar (QField s) Scientific
(*)', namely
_orderAmount order'In the second argument of
(<-.)', namely
(_orderAmount order * 100)'In the expression:
_orderAmount order <-. (_orderAmount order * 100)
order :: OrderT (QField s) (bound at example\EmployeesFB.hs:211:19)
The text was updated successfully, but these errors were encountered: