Workaround: In order to make this mechanism work, remove carriage returns from the SQL query when the query is part of a variable.
Fix Status: No Fix
A remark has been added to the documentation here: Automic Scripting Guide > Ordered by Function > Activate Objects > :READ
With a :READ statement, you can read values that have been put to the input buffer. In this case, do not use text values with line breaks in the input buffer. :READ ignores the characters after the first line break. For more details, see PUT_READ_BUFFER.
It is important to realize that the command :READ is used behind-the-scenes in several areas of the Automation Engine to pass parameters (e.g., passing EXEC VARA parameters). When parameters are passed to the executable object via the :READ buffer, multi-line content can never be used. See the documentation of the :READ script statement mentioned above for more information.