Vivek Sinha
Vivek Sinha

Reputation: 197

Google AppScript large multi-line query string (BigQuery) issue

I have been perplexed by this issue for a long time. I work with pretty massive multi-line bigquery sql strings. When I go to schedule them using Google AppScript, I have to spend hours trying to format them because:

(This question has an example appscript that runs a SQL. That SQL has been formatted to be in one line. In my case it will be multi-line)

Any suggestions how I could possibly avoid this and: 1. Either just copy paste a code block? 2. Or use a "saved query" from my bigquery account?

Thank you!

Upvotes: 0

Views: 1271

Answers (1)

Ron Bailey
Ron Bailey

Reputation: 56

It looks like the backslash is the line continuation character, so if you end each line with a backslash, that should work to make a really long queryString.

i.e.

var queryString = "SELECT * FROM Foo;\

SELECT * FROM Bar"

There's probably some limit to how long the queryString can be, but I don't know what that is.

Seems like there should be a way to use a saved query, but I have not found it.

Upvotes: 2

Related Questions