I can't get a multiline SQL statement to work within a procedure/javascript without putting \ after each line.
This works:
CREATE or replace PROCEDURE PR_DELETEME()
RETURNS VARCHAR
LANGUAGE javascript
AS
$$
var rs = snowflake.execute( { sqlText:
'create or replace table deleteme as select sysdate() as my_date;'
} );
return 'Done.';
$$;
This fails:
CREATE or replace PROCEDURE PR_DELETEME()
RETURNS VARCHAR
LANGUAGE javascript
AS
$$
var rs = snowflake.execute( { sqlText:
'create or replace table deleteme as
select sysdate() as my_date;'
} );
return 'Done.';
$$;
call PR_DELETEME(); gives...
JavaScript compilation error: Uncaught SyntaxError: Invalid or unexpected token in PR_DELETEME at ' 'create or replace table deleteme as' position 6
I really don't want to have to put \ at the end of each line.