2017-06-01 128 views

回答

1

一些嘗試後,我發現這是做工精細:

select to_char 
     (httppost 
     ('https://hooks.slack.com/services/XXX/YYY/zzzzzzzzz' 
     , 'application/json' 
     , to_binary 
      ('{' 
      || jsonencode('channel') 
      || ': ' 
      || jsonencode('#test') 
      || ', ' 
      || jsonencode('username') 
      || ': ' 
      || jsonencode('testuser') 
      || ', ' 
      || jsonencode('text') 
      || ': ' 
      || jsonencode('Companies in city of ' || act.city || ': ' || act.companynames) 
      || '}' 
      ) 
     ) 
     ) 
from (select act.city 
     ,  listagg(act.name) companynames 
     from exactonlinerest..accounts act 
     where act.city in ('Haelen', 'Horn', 'Heythuysen') 
     group 
     by  act.city 
     ) 

的HTTP POST是不是在這個意義上,它有一個副作用非常優雅,但它的工作。

相關問題