How to view a Redshift query

0

I looked at SVL_STATEMENTTEXT but in that view a query is broken up into chunks.

Lynne F
質問済み 1年前578ビュー
1回答
0
承認された回答

SVL_STATEMENTTEXT is the right place to get full query text. As you rightly noticed, when a single statement contains more than 200 characters, additional rows are created for that statement and a sequence number is assigned for each part. Sequence 0 is the first row, 1 is the second, and so on.

To get full query text from SVL_STATEMENTTEXT, you can use the below sample query

select LISTAGG(CASE WHEN LEN(RTRIM(text)) = 0 THEN text ELSE RTRIM(text) END, '') within group (order by sequence) AS query_statement 
from SVL_STATEMENTTEXT where xid=<<your transaction's xid>>
AWS
回答済み 1年前
  • Wonderful! Thank you for the quick response!

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ