The update statement will only include your update sql statement. QIE is doing the query for you and not running Javascript. To include data from the message or source you need to use the NodeTag. {m:NodePath}, {s:NodePath}.
This is what your query above would look like:
Update a
Set a.Status = 'Confirmed via Text'
From Appointments a
Where a.AppointmentsId = {m:SCH-1}
Here is a screenshot of the Update Stmnt box: