File: 409_create_external_function.sql

package info (click to toggle)
sqlfmt 0.29.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,580 kB
  • sloc: python: 10,007; sql: 5,626; makefile: 39
file content (45 lines) | stat: -rw-r--r-- 1,591 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
create or replace external function local_echo(string_col varchar)
    returns variant
    api_integration = demonstration_external_api_integration_01
    as 'https://xyz.execute-api.us-west-2.amazonaws.com/prod/remote_echo';

create secure external function fooooobarrrrr(string_col varchar, int_col int)
    returns variant
    returns null on null input
    immutable
    comment = 'who knows what this will do!?'
    api_integration = bar
    headers = (
    'volume-measure' = 'liters',
    'distance-measure' = 'kilometers'
    )
    context_headers = (current_timestamp)
    compression=gzip
    as 'https://www.example.com/snowflake-external-function'
;
alter function foo set comment = 'something quite long! something quite long! something quite long!';
ALTER FUNCTION foo set api_integration = baz;
)))))__SQLFMT_OUTPUT__(((((
create or replace external function local_echo(string_col varchar)
returns variant
api_integration = demonstration_external_api_integration_01
as 'https://xyz.execute-api.us-west-2.amazonaws.com/prod/remote_echo'
;

create secure external function fooooobarrrrr(string_col varchar, int_col int)
returns variant
returns null on null input
immutable
comment = 'who knows what this will do!?'
api_integration = bar
headers = ('volume-measure' = 'liters', 'distance-measure' = 'kilometers')
context_headers = (current_timestamp)
compression = gzip
as 'https://www.example.com/snowflake-external-function'
;
alter function foo
set comment = 'something quite long! something quite long! something quite long!'
;
alter function foo
set api_integration = baz
;