Create function issue

greengil
Contributor

Hello - I am following some online code to create a function as follows:

-----------------------------------------

CREATE OR REPLACE FUNCTION my_catalog.my_schema.insert_data_function(
col1_value STRING,
col2_value INT
)
RETURNS BOOLEAN
COMMENT 'Inserts data into a table in Unity Catalog.'
RETURN
INSERT INTO my_catalog.my_schema.my_table (column1, column2)
VALUES (col1_value, col2_value);

-----------------------------------------

Then I got an error:

Syntax error at or near 'INTO'. SQLSTATE: 42601

It looks like function is to return do reading only and return a value but not writing something to the table.  Can you please advise?  Thanks!