FL_GET_SCOPED_FILE_URL

Returns the scoped URL of a FILE.

Syntax

Use one of the following:

FL_GET_SCOPED_FILE_URL( <file_expression> )

FL_GET_SCOPED_FILE_URL( <variant_expression> )
Copy

Arguments

file_expression

The argument must be an expression of type FILE.

variant_expression

The argument must be an OBJECT representing a FILE.

Returns

The function returns a VARCHAR.

Examples

Example using an input FILE.

create table file_table(f file);
insert into file_table select to_file(build_scoped_file_url('@mystage', 'image.png'));
Copy
select fl_get_scoped_file_url(f) from file_table;

+--------------------------------------------------------------------------------------------------------------------+
| FL_GET_SCOPED_FILE_URL(F)                                                                                          |
|--------------------------------------------------------------------------------------------------------------------|
| https://snowflake.account.snowflakecomputing.com/api/files/01ba4df2-0100-0001-0000-00040002e2b6/299017/Y6JShH6KjV  |
+--------------------------------------------------------------------------------------------------------------------+
Copy

Example using an input OBJECT.

create table file_table(f object);
insert into file_table select object_construct('SCOPED_FILE_URL', 'https://snowflake.account.snowflakecomputing.com/api/files/01ba4df2-0100-0001-0000-00040002e2b6/299017/Y6JShH6KjV', 'ETAG', '85522e3bd0e4bbb930237f886db3bcee', 'LAST_MODIFIED', 'Wed, 11 Dec 2024 20:24:00 GMT', 'SIZE', 105859, 'CONTENT_TYPE', 'image/jpg');
Copy
select fl_get_scoped_file_url(f) from file_table;

+--------------------------------------------------------------------------------------------------------------------+
| FL_GET_SCOPED_FILE_URL(F)                                                                                          |
|--------------------------------------------------------------------------------------------------------------------|
| https://snowflake.account.snowflakecomputing.com/api/files/01ba4df2-0100-0001-0000-00040002e2b6/299017/Y6JShH6KjV  |
+--------------------------------------------------------------------------------------------------------------------+
Copy
Language: English