ExamGecko
Question list
Search
Search

Question 683 - COF-C02 discussion

Report
Export

What Snowflake objects can contain custom application logic written in JavaScript? (Select TWO)

A.
Stored procedures
Answers
A.
Stored procedures
B.
Stages
Answers
B.
Stages
C.
Tasks
Answers
C.
Tasks
D.
Views
Answers
D.
Views
E.
User-Defined Functions (UDFs)
Answers
E.
User-Defined Functions (UDFs)
Suggested answer: A, E

Explanation:

Snowflake allows users to write custom application logic in JavaScript for two types of objects: Stored Procedures and User-Defined Functions (UDFs).

Stored Procedures: Snowflake stored procedures can be written in JavaScript to encapsulate complex business logic and procedural operations.

CREATE OR REPLACE PROCEDURE my_procedure()

RETURNS STRING

LANGUAGE JAVASCRIPT

EXECUTE AS CALLER

AS

$$

// JavaScript logic here

$$;

User-Defined Functions (UDFs): Snowflake UDFs can be written in JavaScript to perform custom calculations or operations on data.

CREATE OR REPLACE FUNCTION my_function(x FLOAT)

RETURNS FLOAT

LANGUAGE JAVASCRIPT

AS

$$

return x * 2;

$$;

References:

Snowflake Documentation: Stored Procedures

Snowflake Documentation: User-Defined Functions (UDFs)

asked 23/09/2024
krishamrock krishqmrock
34 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first