6846 LOCAL is allowed only on Internal Type. %VSTR
The LOCAL key word, which signifies the "fast-path", is only allowed on the Teradata Internal User Defined Type. It is not allowed on the Distinct or Structured types. If both Source and Target data types specified for a Cast are not Internal UDT type, the Cast routine must not be LOCAL.
Correct the statement and resubmit the query.