# Long command in multiple lines

**URL:** <https://discourse.nodered.org/t/long-command-in-multiple-lines/26190>\
**Category:** General\
**Created:** [6 May 2020 19:45 UTC](https://discourse.nodered.org/t/long-command-in-multiple-lines/26190 "2020-05-06T19:45:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)\
**Post date:** [6 May 2020 19:45 UTC](https://discourse.nodered.org/t/long-command-in-multiple-lines/26190/1 "2020-05-06T19:45:42Z")

</div>

I asked this question long time ago but cannot find it again...  
having a long sql command that i want to write in multiple lines

like:  
`msg.topic = "SELECT id, firstname, lastname FROM MyGuests"`

as:

```auto
 msg.topic="
 SELECT id, firstname, lastname 
 FROM 
 MyGuests"

```

just to make it more readable

Is that possible and if so, how???

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [6 May 2020 19:50 UTC](https://discourse.nodered.org/t/long-command-in-multiple-lines/26190/2 "2020-05-06T19:50:30Z")

</div>

There are a few different ways of doing it.

```auto
msg.topic = String.raw`
 SELECT id, firstname, lastname 
 FROM 
 MyGuests
`;
return msg;

```

or

```auto
msg.topic = "SELECT id, firstname, lastname "+
 "FROM "+
 "MyGuests";
 
return msg;

```

A different option entirely would be to use the Template node where you can enter as many lines as you want.

---

<div class="post-metadata">

**Author:** ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)\
**Post date:** [6 May 2020 19:51 UTC](https://discourse.nodered.org/t/long-command-in-multiple-lines/26190/3 "2020-05-06T19:51:36Z")

</div>

Clear, thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 May 2020 19:51 UTC](https://discourse.nodered.org/t/long-command-in-multiple-lines/26190/4 "2020-05-20T19:51:36Z")

</div>

Closed on 20 May 2020 19:51 UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
