Support for very long SQL queries in SQL panel

In response to problem stated in #269.